Re: CTE inlining

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
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:43:11
Message-ID: 4b7bdda9-a94a-684a-9059-7a423afe03d3@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.
>
> ​Given that we already have
> ​"​
> prevent optimization
> ​"​
> syntax why do we need a decorator on the CTE?

I do not think I follow. Me and some other people here would ideally
allow CTEs to be inlined by default. Some people today use CTEs as
optimization fences, to for example control join order, and the
suggestion here is to add new syntax for CTEs to allow them to
selectively be used as optimization fences.

> ​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.

Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-01 14:43:38 Re: some review comments on logical rep code
Previous Message Peter Eisentraut 2017-05-01 14:42:45 Re: some review comments on logical rep code