[PATCH] Remove stale comment and dead store in BuildTupleHashTable
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 */
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.
The attached patch removes both. Nothing reads tableslot before
slot is actually created.
Regards,
Tatsuya Kawata
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
On 8/11/26 10:01 AM, Quan Zongliang wrote:
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.
This is a very clear and straightforward code refactoring. There won't
be any objections. Change to "Ready for Committer".
--
Quan Zongliang
Hi Quan-san,
This is a very clear and straightforward code refactoring. There won't
be any objections. Change to "Ready for Committer".
Thank you for reviewing the patch and updating the status!
Regards,
Tatsuya Kawata
On Thu, Aug 13, 2026 at 9:26 AM Tatsuya Kawata
<kawatatatsuya0913@gmail.com> wrote:
This is a very clear and straightforward code refactoring. There won't
be any objections. Change to "Ready for Committer".Thank you for reviewing the patch and updating the status!
I've pushed the patch. Thanks!
Regards,
--
Fujii Masao