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 +