From a80fe6a40b35c88db74aa923d7b8a0a5bac76634 Mon Sep 17 00:00:00 2001
From: TatsuyaKawata <kawatatatsuya0913@gmail.com>
Date: Sun, 9 Aug 2026 18:47:54 +0900
Subject: [PATCH v1] Remove stale comment and dead store in
 BuildTupleHashTable()

BuildTupleHashTable() sets hashtable->tableslot to NULL with the comment
"will be made on first lookup".  That was accurate until commit
bf6c614a2f2, which removed the lazy creation from
LookupTupleHashEntry() and made BuildTupleHashTable() create the slot
unconditionally instead.  Since then the comment has described behavior
that no longer exists.

Remove the comment together with the assignment it is attached to.  That
assignment is a dead store: the slot is created unconditionally further
down in the same function, there is no branch that can skip it and no
early return, and nothing reads tableslot before then.  In particular
tuplehash_create() only records the hashtable pointer as private_data
and does not invoke the hash or match functions.
---
 src/backend/executor/execGrouping.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/executor/execGrouping.c b/src/backend/executor/execGrouping.c
index c107514a85d..c03bde2a43c 100644
--- a/src/backend/executor/execGrouping.c
+++ b/src/backend/executor/execGrouping.c
@@ -232,7 +232,6 @@ BuildTupleHashTable(PlanState *parent,
 	hashtable->tuplescxt = tuplescxt;
 	hashtable->tempcxt = tempcxt;
 	hashtable->additionalsize = additionalsize;
-	hashtable->tableslot = NULL;	/* will be made on first lookup */
 	hashtable->inputslot = NULL;
 	hashtable->in_hash_expr = NULL;
 	hashtable->cur_eq_func = NULL;
-- 
2.34.1

