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

Re: WIP: Hierarchical Queries - stage 1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: WIP: Hierarchical Queries - stage 1
Date: 2006-09-22 14:02:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk> writes:
> The main problem I can see with keeping the CTEs outside the rangetable
> is that according to the source, jointree nodes must currently have
> RANGETBLREF nodes as leaf nodes; as I understand it, your suggestion of
> maintaining the CTEs separately would involve something along the lines
> of keeping a separate CTETable and creating some form of CTETBLREF node
> that could be referenced within the jointree.

No, what I'm thinking is that a *reference* to a CTE, from within the
main query's FROM list, would create a "CTERef" RTE and then you'd have
a normal RANGETBLREF node linking to that in the jointree.  This solves
the problem of where do you put the alias: on the RTE.  What's not clear
to me at this point is whether there can be multiple references in a
query to the same CTE --- if there can, I suspect you must have a data
structure like this.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-09-22 14:25:58
Subject: Re: 8.3 Development Cycle
Previous:From: Dave PageDate: 2006-09-22 13:16:53
Subject: 8.3 Development Cycle

pgsql-patches by date

Next:From: Tom LaneDate: 2006-09-22 14:44:04
Subject: Re: [PATCHES] Include file in regress.c
Previous:From: Magnus HaganderDate: 2006-09-22 11:09:42
Subject: Re: [PATCHES] Include file in regress.c

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