pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-hackers@postgresql.org
Subject: Re: WITH RECUSIVE patches 0723
Date: Mon, 28 Jul 2008 19:04:14 -0400
Message-ID: <203.1217286254@sss.pgh.pa.us> (raw)
In-Reply-To: <20080728222446.GC24856@svana.org>
References: <20080725001513.GF16438@fetter.org>
	<20080725.092652.105178884.t-ishii@sraoss.co.jp>
	<87r69gs967.fsf@news-spur.riddles.org.uk>
	<20080728.162925.23020498.t-ishii@sraoss.co.jp>
	<19882.1217256991@sss.pgh.pa.us>
	<87myk1rg4z.fsf@news-spur.riddles.org.uk>
	<20080728222446.GC24856@svana.org>

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



view thread (39+ messages)  latest in thread

Message-ID: <203.1217286254@sss.pgh.pa.us>
Permalink:  ../203.1217286254@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/203.1217286254@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kleptog@svana.org, andrew@tao11.riddles.org.uk, pgsql-hackers@postgresql.org
  Subject: Re: WITH RECUSIVE patches 0723
  In-Reply-To: <203.1217286254@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox