From: Neil Conway <neilc@samurai.com>
To: siracusa@mindspring.com
Cc: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: Select max(foo) and select count(*) optimization
Date: Mon, 05 Jan 2004 15:23:16 -0500
Message-ID: <87k746p2kr.fsf@mailbox.samurai.com> (raw)
In-Reply-To: <BC1F1F20.71370%siracusa@mindspring.com>
References: <BC1F1F20.71370%siracusa@mindspring.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: neilc@samurai.com, siracusa@mindspring.com
Subject: Re: Select max(foo) and select count(*) optimization
In-Reply-To: <87k746p2kr.fsf@mailbox.samurai.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox