"select count(*) from contacts" is too slow! - Mailing list pgsql-general

From Paul Serby
Subject "select count(*) from contacts" is too slow!
Date
Msg-id 3F82F34D.9090608@clockltd.com
Whole thread Raw
Responses Re: "select count(*) from contacts" is too slow!
Re: "select count(*) from contacts" is too slow!
List pgsql-general
Why does 'select count(id) from "tblContacts"' do a sequential scan when the field 'id' is indexed using a btree?

MySql simply looks at the index which is keeping a handy record of the number of rows.

Can anybody explain how and why postgres does this query like it does?

Many thanks

Paul

pgsql-general by date:

Previous
From: "Agostinho Sousa"
Date:
Subject: Postgresql-7.3.4 rpm's for suse?
Next
From: Francois Suter
Date:
Subject: Re: using copy to load odd characters