Re: [HACKERS] CTE inlining - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] CTE inlining
Date
Msg-id 20170512203946.GA31631@momjian.us
Whole thread Raw
In response to Re: [HACKERS] CTE inlining  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] CTE inlining  (Merlin Moncure <mmoncure@gmail.com>)
Re: [HACKERS] CTE inlining  (Adam Brusselback <adambrusselback@gmail.com>)
Re: [HACKERS] CTE inlining  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
On Tue, May  9, 2017 at 05:14:19PM -0400, Tom Lane wrote:
> Ilya Shkuratov <motr.ilya@ya.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
*  most users assume full optimization and it seems natural to turn  _off_ an optimization via a keyword 
*  while some queries can be inlined, all queries can be materialized,  so doing #1 means INLINE would be only a
preference,which could be  confusing
 

Anyway, I am very glad we are considering addressing this in PG 11.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] WITH clause in CREATE STATISTICS
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WITH clause in CREATE STATISTICS