Re: ORDER BY and DISTINCT ON

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ORDER BY and DISTINCT ON
Дата
Msg-id 5380.1071458255@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ORDER BY and DISTINCT ON  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: ORDER BY and DISTINCT ON  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-hackers
Bruno Wolff III <bruno@wolff.to> writes:
> If the sort used to select the records sorts on both the distinct
> expressions and the order by expressions you will get a sensible
> deterministic result.

Sensible in what sense?  ;-)

It seems to me that the existing documentation defines the behavior of
DISTINCT ON as selecting the row within each DISTINCT ON group that is
first according to the ORDER BY columns that are less significant than
the DISTINCT ON keys.  Perhaps this is not clear enough and should be
clarified.  But it doesn't seem very useful to me to extend the behavior
to allow other cases ... what are you really buying if you do so, and
what will it cost in execution time?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ORDER BY and DISTINCT ON
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Resurrecting pg_upgrade