Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAe5f-0007oB-IY for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 16:45:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gAe5d-0003Wy-MH for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 16:45:33 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAe5d-0003Wc-BU for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 16:45:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAe5a-0000Pf-Ow for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 16:45:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w9BGjOho005750; Thu, 11 Oct 2018 12:45:24 -0400 From: Tom Lane To: Alvaro Herrera cc: Robert Haas , Jeevan Chalke , pgsql-hackers@lists.postgresql.org, David Rowley Subject: Re: Soon-to-be-broken regression test case In-reply-to: <20181011163952.emtpcrzkpselhupj@alvherre.pgsql> References: <20181011163952.emtpcrzkpselhupj@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 11 Oct 2018 13:39:52 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5748.1539276324.1@sss.pgh.pa.us> Date: Thu, 11 Oct 2018 12:45:24 -0400 Message-ID: <5749.1539276324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2018-Oct-11, Tom Lane wrote: >> I have been fooling around with a patch to allow pull-up of sub-selects >> that lack any FROM, along the lines discussed in >> https://www.postgresql.org/message-id/15944.1521127664@sss.pgh.pa.us >> I find that it is smart enough to reduce that EXISTS to a plain >> expression, yielding >> >> QUERY PLAN >> ---------------------------------------------------- >> Subquery Scan on tenk1_vw_sec >> -> Index Only Scan using tenk1_unique1 on tenk1 >> Index Cond: (unique1 = 0) >> (3 rows) > Hmm, I have the feeling that this would nullify some tests in > partition_prune also, which IIRC pretend to invoke runtime pruning with > things like "WHERE partcol = (select 1)". Hm, I'm not seeing any regression test result changes there. However, if you're just executing queries and not EXPLAIN'ing them, it's possible something unwanted is happening under the hood. regards, tom lane