Skip site navigation (1) Skip section navigation (2)

Re: "Big O" notation for postgres?

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "H(dot) Hall" <hhall1001(at)reedyriver(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: "Big O" notation for postgres?
Date: 2008-05-21 14:28:59
Message-ID: 36e682920805210728p4fa6c12ft592b1045cbae9dfd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, May 21, 2008 at 10:10 AM, H. Hall <hhall1001(at)reedyriver(dot)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(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

In response to

Responses

pgsql-performance by date

Next:From: Richard HuxtonDate: 2008-05-21 14:39:54
Subject: Re: "Big O" notation for postgres?
Previous:From: H. HallDate: 2008-05-21 14:10:53
Subject: "Big O" notation for postgres?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group