Re: Indices for select count(*)?

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Alexander Scholz <alexander(dot)scholz1(at)freenet(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Indices for select count(*)?
Date: 2005-12-22 14:52:08
Message-ID: 20051222145208.GS72143@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michelle Konzack 2005-12-22 14:52:36 Re: Toolkit for creating editable grid
Previous Message Chris Browne 2005-12-22 13:51:39 Re: contrib extenstions