Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbX3B-0000cP-B8 for pgsql-performance@postgresql.org; Thu, 22 Nov 2012 13:42:41 +0000 Received: from wizmail.org ([2a00:1940:107::2:0:0]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbX39-0000oV-6c for pgsql-performance@postgresql.org; Thu, 22 Nov 2012 13:42:40 +0000 Received: from [217.205.232.238] (helo=[10.137.3.15]) from_AS 4589 by wizmail.org with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.82_RC107) id 1TbX35-0005vc-Fv (return-path ); Thu, 22 Nov 2012 13:42:35 +0000 Message-ID: <50AE2BC9.7040207@wizmail.org> Date: Thu, 22 Nov 2012 13:42:33 +0000 From: Jeremy Harris User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: 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> <50ACF658.10902@archidevsys.co.nz> <50ACF991.3020603@vmware.com> <50AD2BD1.8070206@archidevsys.co.nz> <50AD6D16.9040608@2ndQuadrant.com> In-Reply-To: <50AD6D16.9040608@2ndQuadrant.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/255 X-Sequence-Number: 48621 On 22/11/2012 00:08, Craig Ringer wrote: > WITH > FENCE foo AS (SELECT ...), > bar AS (SELECT ...) > SELECT * FROM bar; > > Are we fencing just foo? Or all expressions? > WITH foo AS (FENCED SELECT ...), bar AS (SELECT ...), SELECT ... ; -- Jeremy