Re: Common Table Expressions (WITH RECURSIVE) patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Common Table Expressions (WITH RECURSIVE) patch
Date
Msg-id 14004.1222922685@sss.pgh.pa.us
Whole thread Raw
In response to Re: Common Table Expressions (WITH RECURSIVE) patch  ("Hitoshi Harada" <umi.tanuki@gmail.com>)
Responses Re: Common Table Expressions (WITH RECURSIVE) patch
List pgsql-hackers
"Hitoshi Harada" <umi.tanuki@gmail.com> writes:
> 2008/10/2 Tom Lane <tgl@sss.pgh.pa.us>:
>> Okay, there's a patch in CVS HEAD that works this way.  Let me know if
>> it needs further tweaking for your purposes.

> 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.

Well, the problem with defining it as "arbitrary" random access is that
there's no way for the tuplestore to throw away old data.

The scheme that I have in mind here is that you keep (at least) two read
pointers, one that is where you're actually reading the data and one
that is nailing down the oldest point you might need to return to.
This is a generalization of the previous mark/restore logic to allow any
number of pairs of mark and restore points.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Fwd: Has anyone built pgbash-7.3 against postgreSQL-8.3?
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Block-level CRC checks