Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vuLh3-00Gdiu-1f for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 02:29:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuLh1-00BjFT-2F for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 02:29:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vuLh1-00BjFL-1I for pgsql-hackers@lists.postgresql.org; Mon, 23 Feb 2026 02:29:03 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vuLgx-00000000jOB-3PHW for pgsql-hackers@postgresql.org; Mon, 23 Feb 2026 02:29:02 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 1537255E0D9 for ; Mon, 23 Feb 2026 03:28:58 +0100 (CET) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 0698355E3BF; Mon, 23 Feb 2026 03:28:58 +0100 (CET) Received: from localhost (unknown [172.22.191.5]) by s980.loopia.se (Postfix) with ESMTP id 050272201564; Mon, 23 Feb 2026 03:28:58 +0100 (CET) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavis); dkim=pass (2048-bit key) header.d=proxel.se Received: from s981.loopia.se ([172.22.191.6]) by localhost (s471.loopia.se [172.22.190.35]) (amavis, port 10024) with LMTP id k79HZ9EaZFJo; Mon, 23 Feb 2026 03:28:57 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 147.28.75.140 Received: from [192.168.0.121] (customer-147-28-75-140.stosn.net [147.28.75.140]) (Authenticated sender: andreas@proxel.se) by s981.loopia.se (Postfix) with ESMTPSA id 6D1B922B16AA; Mon, 23 Feb 2026 03:28:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1771813737; bh=cFYN4vZTxwM4q+2Y/53ZTAwUVGMr5JRBWdi3/7DuvkQ=; h=Date:Subject:To:References:From:In-Reply-To; b=TRQPeSNq6fmhHfrwrPPs39AWCTvlOU25DRv8Pm2OKHJRhabmTxokwqvqnbgixw+tB oRFMAGZwxmF22yOCTcZiVCUsh7yRsfHG3YduKmA11/EVTiuvrg/iBrnbsOFKNwCzIU JMbwdEZtN+cPmYussswXT+aGpZbTHACUIOw45YqwUhmHuvUyAY150pLAPU4QeuYBBN 0YE2yw+qi0JShYB/TZD9mD/+80JyPdeKODK3pZZVjGHksY2dl/ZAZlilMJtJnxIkIz gwgrC9xZI1QYxE41UU0bWQVJ+5bz601bnIX8kgxc3VsZNoSCNjly2qmXSUmWnNFE5p KiUx5rhiyAqsw== Message-ID: Date: Mon, 23 Feb 2026 03:28:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: refactor ExecInitPartitionInfo To: jian he , PostgreSQL-development References: From: Andreas Karlsson Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/21/26 4:07 PM, jian he wrote: > V1 is way too complicated. > IMHO, we can just do > > if (node != NULL) > part_attmap = build_attrmap_by_name(RelationGetDescr(partrel), > RelationGetDescr(firstResultRel), > false); > > We have now consolidated five uses of build_attrmap_by_name into one. Hm, why would that be ok? As far as I can tell the current code tries hard to not build the attmap unless it is actually needed while you propose to build it almost unconditionally. While the code is less complicated with your patch it instead has to do more work in some cases, right? Andreas