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: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: David Fetter <david@fetter.org>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Early WIP/PoC for inlining CTEs
Date: Tue, 09 Apr 2019 15:50:49 -0400
Message-ID: <22900.1554839449@sss.pgh.pa.us> (raw)
In-Reply-To: <6696.1551192698@sss.pgh.pa.us>
References: <c94d0ddb-d7f8-84be-46a2-8eb569561948@2ndquadrant.com>
	<20190214160209.GA13250@alvherre.pgsql>
	<CAHyXU0z6s6gWVYPCuRvNc633+EyG+Y2x_SDp=HhdObNe-U1NEQ@mail.gmail.com>
	<ff927085-883e-6a68-d2e0-e70b6971af4a@2ndquadrant.com>
	<31353.1550351689@sss.pgh.pa.us>
	<62080f95-3934-4700-00ca-7c35630ab7a0@proxel.se>
	<87wolmg60q.fsf@news-spur.riddles.org.uk>
	<6696.1551192698@sss.pgh.pa.us>

I wrote:
> Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
>> So what I think we need to do here is to forbid inlining if (a) the
>> refcount is greater than 1 and (b) the CTE in question contains,
>> recursively anywhere inside its rtable or the rtables of any of its
>> nested CTEs, a "self_reference" RTE.

> That's kind of "ugh" too: it sounds expensive, and doing it in a way
> that doesn't produce false positives would be even more complicated.

After further investigation, I concluded that that wasn't that awful,
so done that way.

I'm still not entirely convinced about the behavior for nested WITHs
with different materialization specifications, but that seems like
a separate topic.

			regards, tom lane





view thread (112+ messages)

Message-ID: <22900.1554839449@sss.pgh.pa.us>
Permalink:  ../22900.1554839449@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22900.1554839449@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, tomas.vondra@2ndquadrant.com, mmoncure@gmail.com, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, michael@paquier.xyz, robertmhaas@gmail.com, andres@anarazel.de, thomas.munro@enterprisedb.com, david@fetter.org
  Subject: Re: Early WIP/PoC for inlining CTEs
  In-Reply-To: <22900.1554839449@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