Re: Sorted group by

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Matthew Wakeling" <matthew(at)flymine(dot)org>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Sorted group by
Date: 2010-08-10 16:37:40
Message-ID: 4C613A04020000250003441E@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Matthew Wakeling <matthew(at)flymine(dot)org> wrote:

> I'm trying to eke a little bit more performance out of an
> application

In addition to the suggestion from Thomas Kellerer, it would be
interesting to try the following and see how performance compares
using real data.

select group, value from tbl x
where not exists
(select * from tbl y
where y.group = x.group and y.number > x.number);

We have a lot of code using this general technique, and I'm curious
whether there are big gains to be had by moving to the windowing
functions. (I suspect there are.)

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jonathan Blitz 2010-08-10 17:38:02 Re: Sorted group by
Previous Message Thom Brown 2010-08-10 16:28:46 Re: Sorted group by