Re: does "select count(*) from mytable" always do a seq

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Culley Harrelson <harrelson(at)gmail(dot)com>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: does "select count(*) from mytable" always do a seq
Date: 2005-01-07 15:17:16
Message-ID: 1105111036.4014.29.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brian Maguire 2005-01-07 15:23:12 J2SE 1.5 Cache Rowset(JSR 114 )
Previous Message Culley Harrelson 2005-01-07 14:45:57 does "select count(*) from mytable" always do a seq scan?