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 1wtbpE-00075X-2J for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Aug 2026 02:02:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wtboB-000hJG-2j for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Aug 2026 02:01:40 +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 1wtboA-000hJ7-2v for pgsql-hackers@lists.postgresql.org; Tue, 11 Aug 2026 02:01:40 +0000 Received: from mail-m16.yeah.net ([220.197.32.17]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wtbo3-000000001w8-2z1s for pgsql-hackers@postgresql.org; Tue, 11 Aug 2026 02:01:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=OuOzz7q4SkB5SGpH9eVznH7ZobjeriCosq+EMQDWeWI=; b=LChpIkWR+Lc+WgFxOiDSWt1JtQtVzLPflWbyv090MTA4Pu9tGbxQjhleLJe1Mu X/trNup5LKPPSGsdB/DJYk/KJAEPl3dxyaU5j64fuXoJTd7M4x+xzResS7Kqiy3a ZidJbQHqLY113n8GQSAxKAmxjKyj2HJEcSHEJSRXC/AaQ= Received: from [192.168.10.54] (unknown []) by gzsmtp2 (Coremail) with UTF8SMTPA id Ms8vCgDnL0dzgnpqsyafAw--.3902S2; Tue, 11 Aug 2026 10:01:24 +0800 (CST) Message-ID: <69ac9183-56fd-47c0-a368-57b74aabd1d1@yeah.net> Date: Tue, 11 Aug 2026 10:01:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Remove stale comment and dead store in BuildTupleHashTable To: Tatsuya Kawata , PostgreSQL-development References: Content-Language: en-US From: Quan Zongliang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: Ms8vCgDnL0dzgnpqsyafAw--.3902S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZF4DGw17Zw17ur1UCw4xXrb_yoWfArg_Cr 45uryDX3s8ZFy8XFW7Xa98AF1fGw4kur1UG348W3sIqr15Aws8ZF93ur9rZF48WrsFy3Z8 ur9Ygw12yr47ujkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-Originating-IP: [111.167.145.220] X-CM-SenderInfo: htxd06xrqjzxxdqjq5hhdkh0dhw/1tbiOBT2G2p6gnQNEwAA35 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/9/26 7:22 PM, Tatsuya Kawata wrote: > Hi, > > While reading the aggregation-related executor code, I noticed a comment > that no longer matches what the code does. > > In BuildTupleHashTable() (src/backend/executor/execGrouping.c) we have: > >     hashtable->tableslot = NULL;    /* will be made on first lookup */ > This initialization was initially introduced in the patch f97aebd1. The hashtable->tableslot is initialized in the LookupTupleHashEntry function. > The slot is no longer made on first lookup.  Commit bf6c614a2f2 removed > the lazy creation from LookupTupleHashEntry() and made > BuildTupleHashTable() create the slot unconditionally, further down in > the same function.  Only the comment and its assignment were left behind. > It also involves patch 773aec7a and its revert patch 2a41507d Initialization is no longer necessary. -- Quan Zongliang