Re: Select max(foo) and select count(*) optimization - Mailing list pgsql-performance

From Doug McNaught
Subject Re: Select max(foo) and select count(*) optimization
Date
Msg-id 87oeth537f.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Select max(foo) and select count(*) optimization  (John Siracusa <siracusa@mindspring.com>)
List pgsql-performance
Paul Tuckfield <paul@tuckfield.com> writes:

> In the case of select count(*), one optimization is to do  a scan of the
> primary key, not the table itself, if the table has a primary key. In a
> certain commercial, lesser database, this is called an "index fast full
> scan".  It would be important to scan the index in physical order
> (sequential physical IO) and not in key order (random physical IO)

That won't work because you still have to hit the actual tuple to
determine visibility.

-Doug

pgsql-performance by date:

Previous
From: Paul Tuckfield
Date:
Subject: Re: Select max(foo) and select count(*) optimization
Next
From: Christopher Browne
Date:
Subject: Re: Select max(foo) and select count(*) optimization