Re: Early WIP/PoC for inlining CTEs
Nico Williams <nico@cryptonector.com>
From: Nico Williams <nico@cryptonector.com>
To: David Fetter <david@fetter.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>, pgsql-hackers@postgresql.org
Date: 2018-07-25T15:32:06Z
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
On Wed, Jul 25, 2018 at 07:42:37AM +0200, David Fetter wrote:
> Please find attached a version rebased atop 167075be3ab1547e18 with
> what I believe are appropriate changes to regression test output. The
> other changes to the regression tests output are somewhat puzzling, as
> they change the actual results of queries. I've also attached both
> the "leftover" diff and the files to which it should be applied.
I think the SQL programmer needs some control over whether a CTE is:
- a materialized view -- and therefore a barrier
- a view (which can then be inlined by the optimizer)
It is possible to add a keyword for this purpose in the WITH syntax:
WITH VIEW (...) AS a_view
, MATERIALIZED VIEW (...) AS a_barrier
...;
This would be a lot like creating TEMP views, but without the catalog
overhead.
(I wonder how hard it would be to partiion the OID namespace into
temp/persistent ranges so that temp schema elements need not be written
into the catalog.)
Nico
--