Re: CTE inlining

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ilya Shkuratov <motr(dot)ilya(at)ya(dot)ru>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Andreas Karlsson <andreas(at)proxel(dot)se>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CTE inlining
Date: 2017-05-12 20:52:40
Message-ID: CAHyXU0yeMHBajnJr475U3fPPTihehST0MpotFRD8BoE9hNNENQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 12, 2017 at 3:39 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> On Tue, May 9, 2017 at 05:14:19PM -0400, Tom Lane wrote:
>> Ilya Shkuratov <motr(dot)ilya(at)ya(dot)ru> writes:
>> > Ok, it seems that most people in discussion are agree that removing optimization
>> > fence is a right thing to do.
>> > Nonetheless I still hoping to discuss the algorithm and its implementation.
>>
>> Yeah, so far we've mainly discussed whether to do that and how to control
>> it, not what the actual results would be.
>
> To summarize, it seems we have two options if we want to add fence
> control to CTEs:
>
> 1. add INLINE to disable the CTE fence
> 2. add MATERIALIZE to enable the CTE fence
>
> or some other keywords. I think most people prefer #2 because:
>
> * most users writing queries prefer #2

Yeah, I think there was rough consensus on this point. I think it's
fair to assume that most (or at least a majority) of queries will
benefit from inlining, people would want to opt out of, rather than
opt in to, generally good optimization strategies. This will hit
some in people today, but this is not a backwards compatibility issue
since performance is generally not really fairly described as
compatibility criteria. If this feature drops we ought to warn people
in the release notes though.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-12 21:15:27 About forced dependencies on catversion.h
Previous Message Alvaro Herrera 2017-05-12 20:48:01 Re: WITH clause in CREATE STATISTICS