Re: Sorted group by

From: Thom Brown <thom(at)linux(dot)com>
To: Matthew Wakeling <matthew(at)flymine(dot)org>
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Sorted group by
Date: 2010-08-10 16:28:46
Message-ID: AANLkTi=yOngjw2-hhoyQ8YiUzQ7JCztWTTU_G_UWO_fb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 10 August 2010 17:06, Thom Brown <thom(at)linux(dot)com> wrote:
> On 10 August 2010 17:03, Matthew Wakeling <matthew(at)flymine(dot)org> wrote:
>> On Tue, 10 Aug 2010, Thomas Kellerer wrote:
>>>
>>> No. It's built in (8.4) and it's called Windowing functions:
>>> http://www.postgresql.org/docs/8.4/static/tutorial-window.html
>>> http://www.postgresql.org/docs/8.4/static/functions-window.html
>>>
>>> SELECT group, last_value(value) over(ORDER BY number)
>>> FROM table
>>
>> I may be mistaken, but as I understand it, a windowing function doesn't
>> reduce the number of rows in the results?
>>
>
> I think you are mistaken.  The last_value function is a window
> function aggregate.  Give it a try.
>

D'oh, no, I'm mistaken. My brain has been malfunctioning today.

--
Thom Brown
Registered Linux user: #516935

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2010-08-10 16:37:40 Re: Sorted group by
Previous Message Greg Smith 2010-08-10 16:27:20 Re: Completely un-tuned Postgresql benchmark results: SSD vs desktop HDD