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 1hsbaV-0000OH-NJ for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2019 23:31:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hsbaU-0006KQ-Id for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2019 23:31:22 +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 1hsbaU-0006IR-7E for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2019 23:31:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hsbaN-0002vz-LL for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2019 23:31:21 +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 x6UNVAZx009480; Tue, 30 Jul 2019 19:31:10 -0400 From: Tom Lane To: David Rowley cc: Amit Langote , Yuzuko Hosoya , PostgreSQL Hackers Subject: Re: Runtime pruning problem In-reply-to: References: <001001d4f44b$2a2cca50$7e865ef0$@lab.ntt.co.jp> <2018.1555473241@sss.pgh.pa.us> <2923.1555474214@sss.pgh.pa.us> <17368.1555608352@sss.pgh.pa.us> <6779.1564525639@sss.pgh.pa.us> <7814.1564527032@sss.pgh.pa.us> <8056.1564527407@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Wed, 31 Jul 2019 11:14:29 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9478.1564529470.1@sss.pgh.pa.us> Date: Tue, 30 Jul 2019 19:31:10 -0400 Message-ID: <9479.1564529470@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On Wed, 31 Jul 2019 at 10:56, Tom Lane wrote: >> The portion of this below the Append is fine, but I argue that >> the Vars above the Append should say "part", not "part_p1". >> In that way they'd look the same regardless of which partitions >> have been pruned or not. > That seems perfectly reasonable for Append / MergeAppend that are for > scanning partitioned tables. What do you propose we do for inheritance > and UNION ALLs? For inheritance, I don't believe there would be any change, precisely because we've historically used the parent rel as reference. For setops we've traditionally used the left input as reference. Maybe we could do better, but I'm not very sure how, since SQL doesn't actually provide any explicit names for the setop result. Making up a name with no basis in the query probably isn't an improvement, or at least not enough of one to justify a change. regards, tom lane