Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iL1iZ-0003wO-15 for pgsql-performance@arkaria.postgresql.org; Thu, 17 Oct 2019 09:05:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iL1iX-00011c-Kv for pgsql-performance@arkaria.postgresql.org; Thu, 17 Oct 2019 09:05:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iL1iX-00011L-7U for pgsql-performance@lists.postgresql.org; Thu, 17 Oct 2019 09:05:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iL1iU-0005fO-QL for pgsql-performance@lists.postgresql.org; Thu, 17 Oct 2019 09:05:08 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9H94Wln017690; Thu, 17 Oct 2019 05:04:32 -0400 From: Tom Lane To: David Conlin cc: pgsql-performance@lists.postgresql.org Subject: Re: Change in CTE treatment in query plans? In-reply-to: <560a2cb6-556f-67a7-3676-dba69f2c69e6@cantab.net> References: <560a2cb6-556f-67a7-3676-dba69f2c69e6@cantab.net> Comments: In-reply-to David Conlin message dated "Tue, 15 Oct 2019 12:28:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19440.1571303072.1@sss.pgh.pa.us> Date: Thu, 17 Oct 2019 11:04:32 +0200 Message-ID: <19441.1571303072@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Conlin writes: > Does anyone know if there's been a change in the way values for CTEs are > displayed in query plans? Offhand I don't recall any such changes, nor does a cursory look through explain.c find anything promising. If you're concerned with a multiply-referenced CTE, one possibility for funny results is that the blame for its execution cost could be spread across the multiple call sites. The same can happen with initplans/subplans. But I'm just guessing; you didn't show any concrete examples so it's hard to be definite. regards, tom lane