Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Martijn van Oosterhout
On Mon, May 19, 2008 at 08:19:17AM +0200, Zoltan Boszormenyi wrote: The standard has a clause to specify depth-first order. However doing a depth-first traversal would necessitate quite a different looking plan and it's far less obvious (to me anyways) how to do it. That would be even cooler

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Zoltan Boszormenyi
Martijn van Oosterhout írta: On Mon, May 19, 2008 at 08:19:17AM +0200, Zoltan Boszormenyi wrote: The standard has a clause to specify depth-first order. However doing a depth-first traversal would necessitate quite a different looking plan and it's far less obvious (to me anyways) how to do

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Zoltan Boszormenyi
Martijn van Oosterhout írta: On Mon, May 19, 2008 at 08:19:17AM +0200, Zoltan Boszormenyi wrote: The standard has a clause to specify depth-first order. However doing a depth-first traversal would necessitate quite a different looking plan and it's far less obvious (to me anyways) how to do

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Martijn van Oosterhout
On Mon, May 19, 2008 at 11:56:17AM +0200, Zoltan Boszormenyi wrote: From an implementation point of view, the only difference between breadth-first and depth-first is that your tuplestore needs to be LIFO instead of FIFO. Are you sure? I think a LIFO tuplestore would simply return reversed

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Zoltan Boszormenyi
Martijn van Oosterhout írta: On Mon, May 19, 2008 at 11:56:17AM +0200, Zoltan Boszormenyi wrote: From an implementation point of view, the only difference between breadth-first and depth-first is that your tuplestore needs to be LIFO instead of FIFO. Are you sure? I think a

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Hannu Krosing
On Sun, 2008-05-18 at 22:17 -0700, David Fetter wrote: On Mon, May 19, 2008 at 12:21:20AM -0400, Gregory Stark wrote: Zoltan Boszormenyi [EMAIL PROTECTED] writes: Also, it seems there are no infinite recursion detection: # with recursive x(level, parent, child) as ( select

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Gregory Stark
Martijn van Oosterhout [EMAIL PROTECTED] writes: From an implementation point of view, the only difference between breadth-first and depth-first is that your tuplestore needs to be LIFO instead of FIFO. I think it's not so simple. How do you reconcile that concept with the join plans like

Re: [PATCHES] [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Zoltan Boszormenyi
Gregory Stark írta: Martijn van Oosterhout [EMAIL PROTECTED] writes: From an implementation point of view, the only difference between breadth-first and depth-first is that your tuplestore needs to be LIFO instead of FIFO. I think it's not so simple. How do you reconcile that