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 1hsaxD-00075Z-F1 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2019 22:50:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hsaxB-0008Pk-7c for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2019 22:50:45 +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 1hsaxA-0008Pd-SL for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2019 22:50:45 +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 1hsax3-0002Xd-By for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2019 22:50:42 +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 x6UMoXWj007815; Tue, 30 Jul 2019 18:50:33 -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> Comments: In-reply-to David Rowley message dated "Wed, 31 Jul 2019 10:32:35 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7813.1564527032.1@sss.pgh.pa.us> Date: Tue, 30 Jul 2019 18:50:32 -0400 Message-ID: <7814.1564527032@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:27, Tom Lane wrote: >> What I had in mind was to revert 1cc29fe7c's ruleutils changes >> entirely, so that ruleutils deals only in Plans not PlanStates. >> Perhaps we've grown some code since then that really needs the >> PlanStates, but what is that, and could we do it some other way? >> I'm not thrilled with passing both of these around, especially >> if the PlanState sometimes isn't there, meaning that no code in >> ruleutils could safely assume it's there anyway. > Are you not worried about the confusion that run-time pruning might > cause if we always show the Vars from the first Append/MergeAppend > plan node, even though the corresponding executor node might have been > pruned? The upper-level Vars should ideally be labeled with the append parent rel's name anyway, no? I think it's likely *more* confusing if those Vars change appearance depending on which partitions get pruned or not. This may be arguing for a change in ruleutils' existing behavior, not sure. But when dealing with traditional-style inheritance, I've always thought that Vars above the Append were referring to the parent rel in its capacity as the parent, not in its capacity as the first child. With new-style partitioning drawing a clear distinction between the parent and all its children, it's easier to understand the difference. regards, tom lane