Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: felix(at)crowfix(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1
Date: 2005-11-27 12:38:57
Message-ID: 37ed240d0511270438l36cb2146le0657bb0f04d487e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-11-27 15:50:22 Re: FW: GRANT question
Previous Message Együd Csaba 2005-11-27 11:32:06 Login limitation?