Re: Query question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query question
Дата
Msg-id 26648.1068828042@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query question  (Neil Conway <neilc@samurai.com>)
Список pgsql-performance
Neil Conway <neilc@samurai.com> writes:
> Interesting -- I wonder if it would be possible for the optimizer to
> detect this and avoid the redundant inner sort ... (/me muses to
> himself)

I think the ability to generate two sort steps is a feature, not a bug.
This has been often requested in connection with user-defined
aggregates, where it's handy to be able to control the order of arrival
of rows at the aggregation function.  If the optimizer suppressed the
inner sort then we'd lose that ability.

            regards, tom lane

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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: Seeking help with a query that takes too long
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Help with count(*)