Re: Hierarchical Queries--Status

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hierarchical Queries--Status
Date: 2007-02-09 01:49:46
Message-ID: 200702090149.l191nkD06558@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Who is working on this item?

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Mon, Sep 04, 2006 at 05:15:57PM +0100, Mark Cave-Ayland wrote:
> > 3) Add planner support so that WITH clauses are mapped to a new type of
> > node that utilises two tuplestores - an output tuplestore and a working
> > tuplestore. The output tuple store will in effect be the contents of the
> > table expression while the working tuplestore holds the results of the
> > last iteration if recursive. Also implement some kind of WithState node
> > which keeps track of the recursion state.
>
> That's basically what I came up with. Basically you have a sort of loop
> in the execution plan where tuples that come out are copied into a
> tuplestore and run through a particular part of the executor again. The
> top-down approach of the executor makes it a bit trickier...
>
> > Having spent some more time today looking at 1) and also at the SQL 2003
> > spec, it would seem that other databases offer the WITH clause within
> > subqueries and also as part of a view. I'd be interested to hear
> > feedback from other developers as to whether it would be possible to
> > achieve this level of support within PostgreSQL.
>
> Absolutly possible. The question is how much work :)
>
> Incidently, if you find a way to support common subplans (where a part
> of the executor is shared between two executions) that might provide a
> way to solve some of the trickier multiple evaluation problems with
> rules. Again, it would just be a tuplestore the stored the results for
> multiple executions.
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > From each according to his ability. To each according to his ability to litigate.
-- End of PGP section, PGP failed!

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-02-09 02:53:19 Re: [PATCHES] Bad bug in fopen() wrapper code
Previous Message Bruce Momjian 2007-02-09 01:29:22 Re: Have psql show current sequnce values - (Resubmission)

Browse pgsql-patches by date

  From Date Subject
Next Message Joshua D. Drake 2007-02-09 02:13:41 Re: \prompt for psql
Previous Message Bruce Momjian 2007-02-09 01:29:22 Re: Have psql show current sequnce values - (Resubmission)