Re: Top-k optimizations?

From: Kris Jurka <books(at)ejurka(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Top-k optimizations?
Date: 2005-01-14 04:07:55
Message-ID: Pine.BSO.4.56.0501132302300.32384@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 13 Jan 2005, David Fetter wrote:

> 3. What kinds of top-k optimizations might (eventually) be included
> in PostgreSQL?
>

See the TODO item:

Allow ORDER BY ... LIMIT 1 to select high/low value without sort or index
using a sequential scan for highest/lowest values

If only one value is needed, there is no need to sort the entire table.
Instead a sequential scan could get the matching value.

There is some discussion of this on the -general list here:

http://groups-beta.google.com/group/comp.databases.postgresql.general/messages/08c615cc2cbdf143,fe626a7cc9021d12,4f1d0575be60c26f,5c44463d8ef0e1ef,ceff42f0dae09272,dc9da98adcb6142c,7f34133e99b38825,28b43c5e79924da6,98be76099ea6513f,5d3f19a69e3b5a93?thread_id=7d35d3eb00ffd0e8&mode=thread&noheader=1&q=oleg+limit+sort#doc_7f34133e99b38825

Kris Jurka

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-01-14 04:17:32 Re: FATAL: catalog is missing 1 attribute(s) for relid 16396
Previous Message Tom Lane 2005-01-14 04:01:12 Re: Bug? 8.0 does not use partial index