Re: Early WIP/PoC for inlining CTEs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Andreas Karlsson <andreas@proxel.se>, David Fetter <david@fetter.org>,
Thomas Munro <thomas.munro@enterprisedb.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-11-16T23:24:51Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Prevent inlining of multiply-referenced CTEs with outer recursive refs.
- 9476131278c7 12.0 landed
-
Allow user control of CTE materialization, and change the default behavior.
- 608b167f9f9c 12.0 landed
-
Split QTW_EXAMINE_RTES flag into QTW_EXAMINE_RTES_BEFORE/_AFTER.
- 18c0da88a5d9 12.0 landed
-
document when PREPARE uses generic plans
- fab9d1da4a21 9.6.0 cited
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