From: Jonah H. Harris <jonah.harris@gmail.com>
To: H. Hall <hhall1001@reedyriver.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: "Big O" notation for postgres?
Date: Wed, 21 May 2008 10:28:59 -0400
Message-ID: <36e682920805210728p4fa6c12ft592b1045cbae9dfd@mail.gmail.com> (raw)
In-Reply-To: <48342D6D.1020506@reedyriver.com>
References: <48342D6D.1020506@reedyriver.com>
On Wed, May 21, 2008 at 10:10 AM, H. Hall <hhall1001@reedyriver.com> wrote:
> Does anyone know if there is a source that provides "Big O" notation for
> postgres's aggregate functions and operations? For example is count(*) =
> O(1) or O(n)?
I don't know of any document containing the complexity of each
aggregate, but it's sometimes left as a comment in the souce code.
IIRC, COUNT (non-distinct) is currently O(n), where n also includes
evaluation of tuples not represented in the final count (due to
Postgres' MVCC design).
--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: jonah.harris@gmail.com, hhall1001@reedyriver.com
Subject: Re: "Big O" notation for postgres?
In-Reply-To: <36e682920805210728p4fa6c12ft592b1045cbae9dfd@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox