Re: pgsql: Re-add item with better description: > * Allow ORDER BY ... - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Re-add item with better description: > * Allow ORDER BY ...
Date
Msg-id 19341.1114442952@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Re-add item with better description: > * Allow ORDER BY ...  (momjian@svr1.postgresql.org (Bruce Momjian))
Responses Re: pgsql: Re-add item with better description: > * Allow  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-committers
momjian@svr1.postgresql.org (Bruce Momjian) writes:
> Re-add item with better description:

>> * Allow ORDER BY ... LIMIT 1 to select high/low value without sort or
>> index using a sequential scan for highest/lowest values
>>
>> Right now, if no index exists, ORDER BY ... LIMIT 1 requires we sort
>> all values to return the high/low value.  Instead The idea is to do a
>> sequential scan to find the high/low value, thus avoiding the sort.

That's not much better, as it simply begs the question "why not use
MIN/MAX"?

I think the real point of Oleg's suggestion is a better way to do "top N"
queries.  This does not get interesting unless N > 1.

            regards, tom lane

pgsql-committers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: pgsql: Remove item, not sure what it refers to:
Next
From: Bruce Momjian
Date:
Subject: Re: pgsql: Re-add item with better description: > * Allow