pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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




view thread (19+ messages)  latest in thread

Message-ID: <87k746p2kr.fsf@mailbox.samurai.com>
Permalink:  ../87k746p2kr.fsf@mailbox.samurai.com/
Also on:    postgresql.org/message-id/87k746p2kr.fsf@mailbox.samurai.com

 · 

reply

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