Re: CTE inlining

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CTE inlining
Date: 2017-05-01 14:53:06
Message-ID: CAKFQuwaxWAOB8kCwwJjAx=co+Nmmy5_HOgs37_-jRoUqc09=Rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 1, 2017 at 7:43 AM, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:

> On 05/01/2017 04:33 PM, David G. Johnston wrote:
> > On Mon, May 1, 2017 at 7:26 AM, Andreas Karlsson <andreas(at)proxel(dot)se
> > I am not sure I like decorators since this means adding an ad hoc
> > query hint directly into the SQL syntax which is something which I
> > requires serious consideration.
>
> > ​I would shorten that to "WITH MAT" except that I don't think that
> > having two way to introduce an optimization fence is worthwhile.
>
> You mean OFFSET 0? I have never been a fan of using it as an optimization
> fence. I do not think OFFSET 0 conveys clearly enough to the reader that is
> is an optimization fence.

​I think I was being too literal in my thinking. Proposing that we
effectively do away with OFFSET 0 and instead recommend "WITH MAT name AS
()" for subqueries requiring standalone evaluation is something I can agree
with. I too have always though of OFFSET 0 as hack-ish which is why my SRF
usage examples have always used CTEs.

David J.​

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-05-01 15:01:26 Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)
Previous Message Corey Huinker 2017-05-01 14:44:44 Re: CTE inlining