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 1gAhqM-0005J8-Qu for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 20:46:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gAhqJ-00053b-Jx for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 20:45:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAhqJ-00053U-Cv for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 20:45:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAhqC-0007d6-Kl for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 20:45:59 +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 w9BKjiTx023508; Thu, 11 Oct 2018 16:45:45 -0400 From: Tom Lane To: David Rowley cc: Alvaro Herrera , Robert Haas , Jeevan Chalke , PostgreSQL Hackers Subject: Re: Soon-to-be-broken regression test case In-reply-to: References: <5749.1539276324@sss.pgh.pa.us> <20181011165251.k7ggwmvmlfjv33gr@alvherre.pgsql> Comments: In-reply-to David Rowley message dated "Fri, 12 Oct 2018 08:45:37 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23506.1539290744.1@sss.pgh.pa.us> Date: Thu, 11 Oct 2018 16:45:44 -0400 Message-ID: <23507.1539290744@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > I guess if we ever did something to break that then we'd need to not > do anything when there are volatile functions present. Yeah, nothing I'm doing here changes the rule that we don't flatten sub-selects containing volatiles in their tlist. > If people are > writing that then probably they're doing so to trick the planner, > perhaps to hide some stats that get outdated easily. I'd imagine we'd > upset more people than we'd please. The specific case I'm aware of is that people sometimes write "(SELECT x)" rather than just "x" so as to make the calculation be a done-only-once InitPlan. That code path isn't affected by this, either (and that's why the partition_prune tests didn't change behavior). It's fair to wonder whether partition_prune needs to be testing other subplan cases besides InitPlans, but that seems like a distinct issue. regards, tom lane