From: Rob Sargent <robjsargent@gmail.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: CTE optimization fence
Date: Wed, 27 Jun 2018 00:27:13 -0600
Message-ID: <31DF665F-B3D6-4D2E-A3C1-53C4E869BB1B@gmail.com> (raw)
In-Reply-To: <d37c4340-ff95-ffe6-02e7-f4adf0352761@gmx.net>
References: <ce9c1fb9-c309-f666-3221-5d5f9e66051e@burgess.co.nz>
<23733.1530071303@sss.pgh.pa.us>
<d37c4340-ff95-ffe6-02e7-f4adf0352761@gmx.net>
I don’t think the fence analogy works. Try wall (a la Berlin).
I count myself amongst those who thought “Ooh this little CTE will garner just what the rest of the query needs”. Only to find the planner didn’t groc that optimization.
Is it a matter of deciding to trust the SQLer and runtime analyzing the CTE product before continuing? As an SQLer I have doubts about that precept but without _some_ change in attack CTEs approach fluff.
> On Jun 26, 2018, at 11:45 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
>
> Tom Lane schrieb am 27.06.2018 um 05:48:
>>> I see there was some discussion last year about removing the CTE
>>> optimization fence (e.g.
>>> http://www.postgresql-archive.org/CTE-inlining-td5958992.html) but can't
>>> find anything more recent. Does anyone know if this is still under
>>> consideration?
>>
>> but we have to settle on a way of controlling it.
>
> +1 from me.
>
> I am running more and more into situations where people consider this a bug rather than a feature.
>
> FWIW, I think a GUC that switches between the current (mostly unwanted, at least surprising)
> way and one where the CTE is optimized together with the main query would suit "most" people.
>
> For sake of compatibility this could default to the current behaviour
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: robjsargent@gmail.com, spam_eater@gmx.net
Subject: Re: CTE optimization fence
In-Reply-To: <31DF665F-B3D6-4D2E-A3C1-53C4E869BB1B@gmail.com>
References: <ce9c1fb9-c309-f666-3221-5d5f9e66051e@burgess.co.nz> <23733.1530071303@sss.pgh.pa.us> <d37c4340-ff95-ffe6-02e7-f4adf0352761@gmx.net> <31DF665F-B3D6-4D2E-A3C1-53C4E869BB1B@gmail.com>
* 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