diff options
author | Jeff Davis <jdavis@postgresql.org> | 2025-03-24 22:06:02 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2025-03-24 22:06:02 -0700 |
commit | 626df47ad9db809dc8f93330175ab95b75914721 (patch) | |
tree | db18183d49021a32b56ba0d42517bbb3f7f416c7 /src/include/executor/executor.h | |
parent | a0942f441ed651f6345d969b7a8f4774eda1fceb (diff) |
Remove 'additional' pointer from TupleHashEntryData.
Reduces memory required for hash aggregation by avoiding an allocation
and a pointer in the TupleHashEntryData structure. That structure is
used for all buckets, whether occupied or not, so the savings is
substantial.
Discussion: https://postgr.es/m/AApHDvpN4v3t_sdz4dvrv1Fx_ZPw=twSnxuTEytRYP7LFz5K9A@mail.gmail.com
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Diffstat (limited to 'src/include/executor/executor.h')
-rw-r--r-- | src/include/executor/executor.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 69396a9d7f8..6a1fec88928 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -188,7 +188,10 @@ TupleHashEntryGetTuple(TupleHashEntry entry) static inline void * TupleHashEntryGetAdditional(TupleHashTable hashtable, TupleHashEntry entry) { - return entry->additional; + if (hashtable->additionalsize > 0) + return (char *) entry->firstTuple - hashtable->additionalsize; + else + return NULL; } #endif |