Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbCSC-0007za-QX for pgsql-performance@postgresql.org; Wed, 21 Nov 2012 15:43:08 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbCSA-0002Kv-59 for pgsql-performance@postgresql.org; Wed, 21 Nov 2012 15:43:07 +0000 Received: from [10.1.1.3] (60-234-150-59.bitstream.orcon.net.nz [60.234.150.59]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id qALFgGl9028303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Nov 2012 04:42:29 +1300 Message-ID: <50ACF658.10902@archidevsys.co.nz> Date: Thu, 22 Nov 2012 04:42:16 +1300 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andres Freund CC: Andrew Dunstan , Tom Lane , Heikki Linnakangas , Craig Ringer , Claudio Freire , Merlin Moncure , David Greco , "pgsql-performance@postgresql.org" Subject: Re: Poor performance using CTE References: <50AC1472.3050607@2ndQuadrant.com> <18123.1353455585@sss.pgh.pa.us> <50ACD166.1000507@vmware.com> <50ACE970.7050701@dunslane.net> <3396.1353509947@sss.pgh.pa.us> <50ACF16C.2020902@dunslane.net> <20121121153209.GA1271@awork2.anarazel.de> In-Reply-To: <20121121153209.GA1271@awork2.anarazel.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201211/258 X-Sequence-Number: 48624 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 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)?