Re: Best way to get the latest revision from a table - Mailing list pgsql-performance

From Shaun Thomas
Subject Re: Best way to get the latest revision from a table
Date
Msg-id D247E79EFD801E40A9449A9724F6295B4C5F5F4F@spswchi6mail1.peak6.net
Whole thread Raw
In response to Re: Best way to get the latest revision from a table  (Nikolas Everett <nik9000@gmail.com>)
List pgsql-performance
> After trying both against the real tables DISTINCT ON seems to be
> about two orders of magnitude faster than the other options.

Glad it worked. It looked at least naively similar to situations I've run into and DISTINCT ON always helped me out.
It'sall the fun of GROUP BY with the ability to discard non-aggregate results just by screwing around with your
sorting.Still one of my favorite tricks. 

--
Shaun Thomas
Peak6 | 141 W. Jackson Blvd. | Suite 800 | Chicago, IL 60604
312-676-8870
sthomas@peak6.com

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Best way to get the latest revision from a table
Next
From: Craig Ringer
Date:
Subject: Re: The good, old times