Re: Indices for select count(*)? - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Indices for select count(*)?
Date
Msg-id 20051222145208.GS72143@pervasive.com
Whole thread Raw
In response to Re: Indices for select count(*)?  (Greg Stark <gsstark@mit.edu>)
Responses Re: Indices for select count(*)?
List pgsql-general
On Wed, Dec 21, 2005 at 04:54:08PM -0500, Greg Stark wrote:
> MSSQL presumably has the entire table cached in RAM and postgres doesn't. Even
> if MSSQL can scan just the index (which postgres can't do) I would only expect
> a factor of 2-4x. Hm. Unless perhaps this table is extremely wide? How large
> are these records?

Back when I was using other databases more often, it wasn't uncommon to
see a 10x speed improvement on count(*) from using an index. This is an
area where PostgreSQL is seriously behind other databases. Of course
having vastly superior concurrency goes a long way towards offsetting
that in the real world, but it would be a Good Thing if we could get
some form of tuple visibility into indexes, as has been discussed in the
past.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: Chris Browne
Date:
Subject: Re: contrib extenstions
Next
From: Michelle Konzack
Date:
Subject: Re: Toolkit for creating editable grid