Re: Poor performance using CTE - Mailing list pgsql-performance

From Andrew Dunstan
Subject Re: Poor performance using CTE
Date
Msg-id 50AD02C6.8070808@dunslane.net
Whole thread Raw
In response to Re: Poor performance using CTE  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: Poor performance using CTE
List pgsql-performance
On 11/21/2012 11:32 AM, Claudio Freire wrote:
> On Wed, Nov 21, 2012 at 1:24 PM, Andres Freund <andres@2ndquadrant.com> wrote:
>> On 2012-11-21 13:16:25 -0300, Claudio Freire wrote:
>>> On Wed, Nov 21, 2012 at 12:32 PM, Andres Freund <andres@anarazel.de> wrote:
>>>> +1
>>>>
>>>> WITH foo AS (SELECT ...) (barrier=on|off)?
>>>>
>>>> 9.3 introduces the syntax, defaulting to on
>>>> 9.4 switches the default to off.
>>> Why syntax? What about a guc?
>>>
>>> collapse_cte_limit?
>> Because there are very good reasons to want to current behaviour. A guc
>> is a global either/or so I don't see it helping much.
> set collapse_cte_limit=8;
> with blah as (blah) select blah;
>
> Not global at all.
>

Then you have to unset it again, which is ugly. You might even want it
applying to *part* of a query, not the whole thing, so this strikes me
as a dead end.

cheers

andrew


pgsql-performance by date:

Previous
From: Andres Freund
Date:
Subject: Re: Poor performance using CTE
Next
From: Claudio Freire
Date:
Subject: Re: Poor performance using CTE