Skip site navigation (1) Skip section navigation (2)

Re: Select max(foo) and select count(*) optimization

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Select max(foo) and select count(*) optimization
Date: 2004-01-06 00:29:56
Message-ID: 87oeth537f.fsf@asmodeus.mcnaught.org (view raw or flat)
Thread:
Lists: pgsql-performance
Paul Tuckfield <paul(at)tuckfield(dot)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


In response to

pgsql-performance by date

Next:From: Christopher BrowneDate: 2004-01-06 01:46:00
Subject: Re: Select max(foo) and select count(*) optimization
Previous:From: Paul TuckfieldDate: 2004-01-06 00:24:26
Subject: Re: Select max(foo) and select count(*) optimization

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group