Skip site navigation (1) Skip section navigation (2)

Re: Common Table Expressions (WITH RECURSIVE) patch

From: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Greg Stark" <stark(at)enterprisedb(dot)com>, "Dimitri Fontaine" <dfontaine(at)hi-media(dot)com>, "Jeff Davis" <pgsql(at)j-davis(dot)com>, "Tatsuo Ishii" <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Date: 2008-10-02 01:16:47
Message-ID: e08cc0400810011816y17a35d9dsbcea5f7d4cfb8791@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
2008/10/2 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com> writes:
>>> I hadn't realized that this would be relevant to window functions.
>>> Now that I know that, I propose fixing tuplestore for multiple
>>> positions and committing it separately, before I go back to the CTE
>>> patch.  Then Hitoshi-san will have something he can work with too.
>
>> Yes, tuplestore multiple positioning will give the greate help to the
>> window function. Ideally, it is better that tuplestore'd have all the
>> positions and have some kind of capability to discard old rows so that
>> it can stay in TSS_MEM, which helps window function's sliding frame.
>
> Okay, there's a patch in CVS HEAD that works this way.  Let me know if
> it needs further tweaking for your purposes.
>
>                        regards, tom lane
>

Hmm, I've looked over the patch. Logically window functions can access
arbitrary rows that have been stored in a frame. Thus I had thought
tuplestore should hold all the positions and allow arbitrary random
access indicated by integer. Maybe those functionalities can be
abstracted by the window function API itself. For this matter it seems
that you'd better to look at my future patch.
Everything else is great deal. By improving tuplestore_trim(), sliding
frame will be performed better than I'd thought.

Regards,


-- 
Hitoshi Harada

In response to

Responses

pgsql-hackers by date

Next:From: Gurjeet SinghDate: 2008-10-02 01:22:56
Subject: Re: Fwd: Has anyone built pgbash-7.3 against postgreSQL-8.3?
Previous:From: Alvaro HerreraDate: 2008-10-02 00:34:42
Subject: Re: Transactions within a function body

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group