Re: Speeding up Aggregates

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Speeding up Aggregates
Дата
Msg-id 20031010013522.GB18596@wolff.to
обсуждение исходный текст
Ответ на Re: Speeding up Aggregates  (Dror Matalon <dror@zapatec.com>)
Ответы Re: Speeding up Aggregates  (Dror Matalon <dror@zapatec.com>)
Список pgsql-performance
On Thu, Oct 09, 2003 at 17:44:46 -0700,
  Dror Matalon <dror@zapatec.com> wrote:
>
> How is doing order by limit 1 faster than doing max()? Seems like the
> optimizer will need to sort or scan the data set either way. That part
> didn't actually make a difference in my specific case.

max() will never be evaluated by using an index to find the greatest value.
So in many cases using order by and limit 1 is faster.

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

Предыдущее
От: Dror Matalon
Дата:
Сообщение: Re: Speeding up Aggregates
Следующее
От: Dennis Bjorklund
Дата:
Сообщение: Re: OFFTOPIC: PostgreSQL vs MySQL