Re: [HACKERS] Much Ado About COUNT(*)

From: Wes <wespvp(at)syntegra(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] Much Ado About COUNT(*)
Date: 2005-01-14 17:04:43
Message-ID: BE0D57CB.3FAF%wespvp@syntegra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 1/13/05 6:44 PM, "Greg Stark" <gsstark(at)mit(dot)edu> wrote:

> That's simply false. Oracle does indeed have to count the records one by one.
>
> It doesn't have to read and ignore the dead records since they're in a
> separate place (but on the other hand it sometimes have to go read that
> separate place when it sees records that were committed after your
> transaction).
>
> It can also do index-only scans, which often helps, but it's still not
> instantaneous.

Ok, I stand corrected - I was given some wrong information. However, my
experience has been that count(*) on Oracle is a whole lot faster than
PostgreSQL - what appeared instantaneous on Oracle took some time on
PostgreSQL. That was one of the first things I noticed when moving a
database application to PostgreSQL. I've since disposed of the Oracle
database, so can't go back and retest.

Wes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2005-01-14 17:22:11 Re: [HACKERS] Much Ado About COUNT(*)
Previous Message Bruno Wolff III 2005-01-14 16:58:24 Re: Problem Dropping a Database with users connected to it

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2005-01-14 17:06:58 Re: FATAL: catalog is missing 1 attribute(s) for relid
Previous Message Marc G. Fournier 2005-01-14 16:58:40 Re: FATAL: catalog is missing 1 attribute(s) for relid