Re: Poor performance using CTE

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Craig Ringer <craig(at)2ndQuadrant(dot)com>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, David Greco <David_Greco(at)harte-hanks(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Poor performance using CTE
Date: 2012-11-21 15:42:16
Message-ID: 50ACF658.10902@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 22/11/12 04:32, Andres Freund wrote:
> On 2012-11-21 10:21:16 -0500, Andrew Dunstan wrote:
>> On 11/21/2012 09:59 AM, Tom Lane wrote:
>>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>>> If we're going to do it can we please come up with something more
>>>> intuitive and much, much more documented than "OFFSET 0"? And if/when we
>>>> do this we'll need to have big red warnings all over then release notes,
>>>> since a lot of people I know will need to do some extensive remediation
>>>> before moving to such a release.
>>> The probability that we would actually *remove* that behavior of OFFSET
>>> 0 is not distinguishable from zero. I'm not terribly excited about
>>> having an alternate syntax to specify an optimization fence, but even
>>> if we do create such a thing, there's no need to break the historical
>>> usage.
>>>
>> I wasn't talking about removing it. My point was that if the optimization
>> fence around CTEs is removed a lot of people will need to rework apps where
>> they have used them for that purpose. And I continue to think that spelling
>> it "OFFSET 0" is horribly obscure.
> +1
>
> WITH foo AS (SELECT ...) (barrier=on|off)?
>
> 9.3 introduces the syntax, defaulting to on
> 9.4 switches the default to off.
>
> Greetings,
>
> Andres Freund
>
>

WITH foo AS (SELECT ...) (fence=on|off)?

WITH foo AS (SELECT ...) (optimisation_fence=on|off)?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Heikki Linnakangas 2012-11-21 15:56:01 Re: Poor performance using CTE
Previous Message Peter Geoghegan 2012-11-21 15:32:22 Re: Poor performance using CTE