Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1 - Mailing list pgsql-general

From Brendan Jurd
Subject Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1
Date
Msg-id 37ed240d0511270438l36cb2146le0657bb0f04d487e@mail.gmail.com
Whole thread Raw
In response to Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-general
> Already done in 8.1.  Here's an excerpt from the Release Notes:
>
> Automatically use indexes for MIN() and MAX() (Tom)
>
>     In previous releases, the only way to use an index for MIN()
>     or MAX() was to rewrite the query as SELECT col FROM tab ORDER
>     BY col LIMIT 1.  Index usage now happens automatically.
>

Which query form will generally be faster in 8.1 (or will they be
exactly the same)?

BJ

pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: Login limitation?
Next
From: Michael Fuhr
Date:
Subject: Re: FW: GRANT question