Re: "Big O" notation for postgres? - Mailing list pgsql-performance

From Jonah H. Harris
Subject Re: "Big O" notation for postgres?
Date
Msg-id 36e682920805210728p4fa6c12ft592b1045cbae9dfd@mail.gmail.com
Whole thread Raw
In response to "Big O" notation for postgres?  ("H. Hall" <hhall1001@reedyriver.com>)
Responses Re: "Big O" notation for postgres?  (Richard Huxton <dev@archonet.com>)
List pgsql-performance
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/

pgsql-performance by date:

Previous
From: "H. Hall"
Date:
Subject: "Big O" notation for postgres?
Next
From: Richard Huxton
Date:
Subject: Re: "Big O" notation for postgres?