pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Andreas Karlsson <andreas@proxel.se>
Cc: David Fetter <david@fetter.org>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Early WIP/PoC for inlining CTEs
Date: Fri, 16 Nov 2018 18:24:51 -0500
Message-ID: <10371.1542410691@sss.pgh.pa.us> (raw)
In-Reply-To: <87in0wu0v9.fsf@news-spur.riddles.org.uk>
References: <87sh48ffhb.fsf@news-spur.riddles.org.uk>
	<20180725054236.GB17411@fetter.org>
	<87bmavfjhy.fsf@news-spur.riddles.org.uk>
	<20180725191447.GE17411@fetter.org>
	<CAEepm=0MKV3MnR4Dn5RkXsK+RnmHEFitqiG4PcBhXtBK4JOoWw@mail.gmail.com>
	<20180727081058.GN17411@fetter.org>
	<dccb37dd-2f52-dbd7-a4c4-72a5853f4838@proxel.se>
	<e02af96a-3e25-5de4-09a4-a7ebf3452184@proxel.se>
	<8810.1542402910@sss.pgh.pa.us>
	<87in0wu0v9.fsf@news-spur.riddles.org.uk>

Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  Tom> * I have no faith in the idea that we can skip doing a copyObject
>  Tom> on the inlined subquery, except maybe in the case where we know
>  Tom> there's exactly one reference.

> The code doesn't do a copyObject on the query if there are no level
> changes because everywhere else just does another copyObject on it as
> the first processing step (cf. set_subquery_pathlist and the various
> functions called from pull_up_subqueries).

Perhaps it's safe today, but is that likely to remain true?  We've had
enough pain in the past from multiply-linked parse subtrees that I am
not eager to introduce another case, especially not here where there's
absolutely no evidence that it'd provide a meaningful performance
improvement.

>  Tom> * Speaking of the comments, I'm not convinced that view rewrite is
>  Tom> a good comparison point; I think this is more like subquery
>  Tom> pullup.

> It's not really like subquery pullup because we actually do go on to do
> subquery pullup _after_ inlining CTEs.

Subquery pullup can happen across multiple levels, too.

			regards, tom lane




view thread (112+ messages)  latest in thread

Message-ID: <10371.1542410691@sss.pgh.pa.us>
Permalink:  ../10371.1542410691@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10371.1542410691@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, andreas@proxel.se, david@fetter.org, thomas.munro@enterprisedb.com
  Subject: Re: Early WIP/PoC for inlining CTEs
  In-Reply-To: <10371.1542410691@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