Re: WITH RECUSIVE patches 0723 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WITH RECUSIVE patches 0723
Date
Msg-id 203.1217286254@sss.pgh.pa.us
Whole thread Raw
In response to Re: WITH RECUSIVE patches 0723  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: WITH RECUSIVE patches 0723  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.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


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: [RFC] Unsigned integer support.
Next
From: Andrew Dunstan
Date:
Subject: Re: WITH RECUSIVE patches 0723