On 10/26/2010 6:56 AM, AI Rumman wrote:
> Which one is faster?
> select count(*) from talble
> select count(id) from table
> where id is the primary key.
PostgreSQL doesn't utilize the access methods known as "FULL INDEX SCAN"
and "FAST FULL INDEX SCAN", so the optimizer will generate the
sequential scan in both cases. In other words, PostgreSQL will read the
entire table when counting, no matter what.
Sr. Oracle DBA
New York, NY 10036
In response to
pgsql-performance by date
|Next:||From: Robert Haas||Date: 2010-10-26 12:41:13|
|Subject: Re: BBU Cache vs. spindles|
|Previous:||From: Robert Haas||Date: 2010-10-26 12:24:34|
|Subject: Re: Auto ANALYZE criteria|