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

From Neil Conway
Subject Re: Select max(foo) and select count(*) optimization
Date
Msg-id 87k746p2kr.fsf@mailbox.samurai.com
Whole thread Raw
In response to Select max(foo) and select count(*) optimization  (John Siracusa <siracusa@mindspring.com>)
List pgsql-performance
John Siracusa <siracusa@mindspring.com> writes:
> 1. The query "select max(foo) from bar" where the column foo has an index.
> Aren't indexes ordered?  If not, an "ordered index" would be useful in this
> situation so that this query, rather than doing a sequential scan of the
> whole table, would just "ask the index" for the max value and return nearly
> instantly.

http://www.postgresql.org/docs/current/static/functions-aggregate.html

-Neil


pgsql-performance by date:

Previous
From: Rod Taylor
Date:
Subject: Re: deferred foreign keys
Next
From: Christopher Browne
Date:
Subject: Re: Use my (date) index, darn it!