Re: [HACKERS] WITH RECURSIVE patch V0.1

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Zoltan Boszormenyi <zb(at)cybertec(dot)at>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] WITH RECURSIVE patch V0.1
Date: 2008-05-19 08:42:23
Message-ID: 20080519084223.GA14142@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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 to have it implemented as well.

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. However, just looking at the plan I don't know whether
it could support that kind of usage. At the very least I don't think
the standard tuplestore code can handle it.

> >Well, psql might wait and wait but it's actually receiving rows. A cleverer
> >client should be able to deal with infinite streams of records.
>
> I think it's the other way around. The server should not emit infinite
> number of records.

The server won't, the universe will end first. This is a nice example
of the halting problem:

http://en.wikipedia.org/wiki/Halting_problem

Which was proved unsolvable a long time ago.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yoshiyuki Asaba 2008-05-19 08:57:17 Re: WITH RECURSIVE patch V0.1
Previous Message Michael Meskes 2008-05-19 08:40:15 Re: What in the world is happening on spoonbill?

Browse pgsql-patches by date

  From Date Subject
Next Message Yoshiyuki Asaba 2008-05-19 08:57:17 Re: WITH RECURSIVE patch V0.1
Previous Message Zoltan Boszormenyi 2008-05-19 06:19:17 Re: WITH RECURSIVE patch V0.1