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

From Nicolas Barbier
Subject Re: Indices for select count(*)?
Date
Msg-id b0f3f5a10512211325q7e382bbbga81c78242fbb7313@mail.gmail.com
Whole thread Raw
In response to Indices for select count(*)?  (Alexander Scholz <alexander.scholz1@freenet.de>)
List pgsql-general
On 12/21/05, Alexander Scholz <alexander.scholz1@freenet.de> wrote:

> Regarding the performance flow when trying to find out how many records
> are currently being stored in the table, I don't see how an index should
> help... Nevertheless we've created an unique index on "ID" but SELECT
> count("ID") from "XYZ" still takes 35 seconds*. (ID is the primary key
> basing on a sequence, select count(*) isn't faster.)

I would like to redirect you to the zillions of mailing list posts
about this subject :-).

> So - what kind of indexing would speed this up then?

None.

greetings,
Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Indices for select count(*)?
Next
From: Marcus Engene
Date:
Subject: Re: Indices for select count(*)?