Re: introduction of WIP window function patch

From: H(dot)Harada <umi(dot)tanuki(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: introduction of WIP window function patch
Date: 2008-07-05 18:46:58
Message-ID: e08cc0400807051146o30c65166k3c9f13f55e4b3118@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/7/5 Martijn van Oosterhout <kleptog(at)svana(dot)org>:
> On Sat, Jul 05, 2008 at 07:04:29PM +0900, H.Harada wrote:
>> Hi,
>>
>> As I proposed a month before, I am working on window function.
>
> Very nice!
>
>> http://umitanuki.net/pgsql/wfv01/design.html
>>
>> The problem is, as written in the "Things to discussed" section of the
>> document, how you define window functions (e.g. RANK()). My idea is to
>> treat them as specialized functions such as SET OF functions and mark
>> it in pg_proc. But this doesn't resolve RANK() boundary problem.
>
> Actually, I would make RANK() and ROW_NUMBER() act more like
> aggregates. ISTM you have two kinds of window functions:
>
> - aggregation: a result is calculated over a set and the result copied
> across all the rows.
> - order depenadant: same as above, but the result is different for each
> row.

So I agree the definition of these two types.

> I think you could make the latter work using the current aggregation
> setup, just by calling the final_func for each row rather than just
> once at the end.

How do you know which type of two above is used in the same SQL syntax?

--
Hitoshi Harada

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-07-05 20:12:33 Re: introduction of WIP window function patch
Previous Message H.Harada 2008-07-05 18:40:48 Re: introduction of WIP window function patch