Re: [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 con

Re: [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 l

Re: [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 ( > >

Re: [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 LIF

Re: [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 rev

Re: [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 i

Re: [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 i

Re: [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

Re: [HACKERS] WITH RECURSIVE patch V0.1

2008-05-19 Thread Zoltan Boszormenyi
Gregory Stark írta: This is indeed really cool. I'm sorry I haven't gotten to doing what I promised in this area but I'm glad it's happening anyways. "Zoltan Boszormenyi" <[EMAIL PROTECTED]> writes: Can we get the rows in tree order, please? ... After all, I didn't specify any ORDER BY cl

Re: [HACKERS] WITH RECURSIVE patch V0.1

2008-05-18 Thread Gregory Stark
This is indeed really cool. I'm sorry I haven't gotten to doing what I promised in this area but I'm glad it's happening anyways. "Zoltan Boszormenyi" <[EMAIL PROTECTED]> writes: > Can we get the rows in tree order, please? >... > After all, I didn't specify any ORDER BY clauses in the base, r

Re: [HACKERS] WITH RECURSIVE patch V0.1

2008-05-18 Thread Gregory Stark
"David Fetter" <[EMAIL PROTECTED]> writes: > 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 1::i

Re: [HACKERS] WITH RECURSIVE patch V0.1

2008-05-18 Thread David Fetter
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 1::integer, * from test_connect_by where parent is null