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

From Culley Harrelson
Subject does "select count(*) from mytable" always do a seq scan?
Date
Msg-id 529825a3050107064538c85b55@mail.gmail.com
Whole thread Raw
Responses Re: does "select count(*) from mytable" always do a seq
List pgsql-general
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?

culley

pgsql-general by date:

Previous
From: Lonni J Friedman
Date:
Subject: Re: PostgreSQL Deployment
Next
From: Tino Wildenhain
Date:
Subject: Re: does "select count(*) from mytable" always do a seq