Re: Extracting superlatives - SQL design philosophy - Mailing list pgsql-performance

From Richard Huxton
Subject Re: Extracting superlatives - SQL design philosophy
Date
Msg-id 4B85B259.4030900@archonet.com
Whole thread Raw
In response to Re: Extracting superlatives - SQL design philosophy  (Dave Crooke <dcrooke@gmail.com>)
Responses Re: Extracting superlatives - SQL design philosophy
List 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 by date:

Previous
From: Craig James
Date:
Subject: Re: Extracting superlatives - SQL design philosophy
Next
From: Dave Crooke
Date:
Subject: Re: Extracting superlatives - SQL design philosophy