Re: pgsql: Remove item, not sure what it refers to:

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pgsql: Remove item, not sure what it refers to:
Дата
Msg-id 200504251305.j3PD5lm28145@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Remove item, not sure what it refers to:  (Kris Jurka <books@ejurka.com>)
Ответы Re: pgsql: Remove item, not sure what it refers to:  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-committers
Kris Jurka wrote:
>
>
> On Sat, 23 Apr 2005, Bruce Momjian wrote:
>
> > Log Message:
> > -----------
> > Remove item, not sure what it refers to:
> >
> > < * 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.
> > <
>
> This is actually a suggestion from Oleg here:
>
> http://archives.postgresql.org/pgsql-general/2002-04/msg00464.php
>
> double min = DBL_MAX;
> for (i=0; i<N; i++) {
>     if (data[i] < min) {
>     min = data[i];
>     }
> }

OK, so you are saying that right now if we want ORDER BY ... LIMIT 1,
and there is no index, we sort the result then pick the high value,
rather than just doing a sequential scan and grabbing the high/low
value.  Makes sense now.

Thanks, TODO item readded with a clearer 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.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-committers по дате отправления:

Предыдущее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Re-add item with better description: > * Allow ORDER BY ...
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: pgsql: Remove item, not sure what it refers to: