Re: WITH RECUSIVE patches 0723

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH RECUSIVE patches 0723
Date: 2008-07-28 23:04:14
Message-ID: 203.1217286254@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Since the problem is using the result of a WITH clause more than once,
> would it be sufficient to simply detect that case and bail? You don't
> want materialisation is most cases, there's just a few where it is
> needed.

Really? I tried googling to see what other people thought that the
WITH clause was for, and the first relevant hit I got was this one:
http://www.oracle-developer.net/display.php?id=212
which certainly treats it as a key part of the feature.

My thought is that we could optimize away materialization in cases where
we can tell it's not needed (no volatile functions and/or no multiple
scans of the subquery). But not being able to do it means we've
implemented the feature incorrectly.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-07-28 23:09:08 Re: WITH RECUSIVE patches 0723
Previous Message Gregory Stark 2008-07-28 22:54:28 Re: [RFC] Unsigned integer support.

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2008-07-28 23:09:08 Re: WITH RECUSIVE patches 0723
Previous Message Martijn van Oosterhout 2008-07-28 22:24:46 Re: WITH RECUSIVE patches 0723