Re: [HACKERS] WITH RECURSIVE patch V0.1
Martijn van Oosterhout <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.patches,gmane.comp.db.postgresql.devel.general |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> http://svana.org/kleptog/ > Please line up in a tree and maintain the heap invariant while > boarding. Thank you for flying nlogn airlines.
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIMT1vIB7bNG8LQkwRAqg1AJ9NKQyGSU34nnE7JqMlyh2I7QF/5gCdEwp+ 51Vpop3UfO6FaNjEZ200m+M= =bnxY -----END PGP SIGNATURE-----