Re: Extracting superlatives - SQL design philosophy

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Extracting superlatives - SQL design philosophy
Дата
Msg-id 4B85B259.4030900@archonet.com
обсуждение исходный текст
Ответ на Re: Extracting superlatives - SQL design philosophy  (Dave Crooke <dcrooke@gmail.com>)
Ответы Re: Extracting superlatives - SQL design philosophy  (Dave Crooke <dcrooke@gmail.com>)
Список pgsql-performance
On 24/02/10 22:47, Dave Crooke wrote:
> I'd imagine it would be possible to have a query planner optimization
> that would convert Garrett's DISTINCT ON syntax to do what I was
> trying to, by realizing that DISTINCT ON X ... ORDER BY Y DESC is
> going to return the the one row for each X which has the highest value
> of Y, and so use a MAX-structured accumulation instead of a sort.

Why is there only one row? For city temperatures, that seems unlikely.

In the event of more than one row does your algorithm give repeatable
results?

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Craig James
Дата:
Сообщение: Re: Extracting superlatives - SQL design philosophy
Следующее
От: Dave Crooke
Дата:
Сообщение: Re: Extracting superlatives - SQL design philosophy