Re: slow plan for min/max

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: slow plan for min/max
Дата
Msg-id 20030909184954.GA14198@wolff.to
обсуждение исходный текст
Ответ на Re: slow plan for min/max  (Greg Stark <gsstark@mit.edu>)
Список pgsql-performance
On Tue, Sep 09, 2003 at 12:54:04 -0400,
  Greg Stark <gsstark@mit.edu> wrote:
>
> So what would it take to implement this for "all" aggregates? Where I think
> "all" really just means min(), max(), first(), last().

There can be other aggregates where indexes are helpful. The case of interest
is when functions such that if the new item is contains the current value
of the aggregate then the new value of the aggregate with be that of the
current item. This allows you to skip looking at all of the other items
contained in the current item. Dual problems can also benefit in a similar
manner. In a case where the set is totally ordered by the contains index
(as is the case or max and min) then the problem is even simpler and you
can use the greatest or least element as appropiate.

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: slow plan for min/max
Следующее
От: Thomas Swan
Дата:
Сообщение: Re: slow plan for min/max