Re: does "select count(*) from mytable" always do a seq - Mailing list pgsql-general

From Tino Wildenhain
Subject Re: does "select count(*) from mytable" always do a seq
Date
Msg-id 1105111036.4014.29.camel@Andrea.peacock.de
Whole thread Raw
In response to does "select count(*) from mytable" always do a seq scan?  (Culley Harrelson <harrelson@gmail.com>)
Responses Re: does "select count(*) from mytable" always do a seq  (Bruno Wolff III <bruno@wolff.to>)
Re: does "select count(*) from mytable" always do a seq scan?  (Culley Harrelson <harrelson@gmail.com>)
List pgsql-general
Am Freitag, den 07.01.2005, 06:45 -0800 schrieb Culley Harrelson:
> Hi,
>
> I am using Postgresql 7.4.  I have a table with 1.5 million rows.  It
> has a primary key. VACUUM FULL ANALYZE is run every night.  There are
> 2000-5000 inserts on this table every day but very few updates and
> deletes.  When I select count(*) from this table it is using a
> sequence scan.  Is this just life or is there some way to get this to
> do an index scan?

How do you think an index would help if you do an unconditional
count(*)?

Regards
Tino


pgsql-general by date:

Previous
From: Culley Harrelson
Date:
Subject: does "select count(*) from mytable" always do a seq scan?
Next
From: "Brian Maguire"
Date:
Subject: J2SE 1.5 Cache Rowset(JSR 114 )