Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAMRJ-00083M-Mo for pgsql-general@arkaria.postgresql.org; Fri, 12 Feb 2021 00:36:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAMRI-0005DO-7I for pgsql-general@arkaria.postgresql.org; Fri, 12 Feb 2021 00:36:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAMRH-0005DH-Vg for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 00:36:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAMRF-0000DN-IL for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 00:36:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11C0Zw7Y1510831; Thu, 11 Feb 2021 19:35:58 -0500 From: Tom Lane To: Michael Lewis cc: Steve Baldwin , "pgsql-generallists.postgresql.org" Subject: Re: Consequence of changes to CTE's in 12 In-reply-to: References: Comments: In-reply-to Michael Lewis message dated "Thu, 11 Feb 2021 17:23:45 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1510829.1613090158.1@sss.pgh.pa.us> Date: Thu, 11 Feb 2021 19:35:58 -0500 Message-ID: <1510830.1613090158@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Lewis writes: > If you move the limit 1 to the first CTE, does it not give you the same > behavior in both versions? Not sure if that's exactly the same, but certainly adding a traditional optimization fence (OFFSET 0) to the first CTE should do the trick. regards, tom lane