diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 54e7806fc0..e81598ddfe 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -272,6 +272,7 @@ #include "utils/logtape.h" #include "utils/lsyscache.h" #include "utils/memutils.h" +#include "utils/memutils_memorychunk.h" #include "utils/syscache.h" #include "utils/tuplesort.h" @@ -314,10 +315,10 @@ #define HASHAGG_HLL_BIT_WIDTH 5 /* - * Estimate chunk overhead as a constant 16 bytes. XXX: should this be - * improved? + * Assume the palloc overheads for tuple allocation always use + * sizeof(MemoryChunk) bytes. */ -#define CHUNKHDRSZ 16 +#define CHUNKHDRSZ sizeof(MemoryChunk) /* * Represents partitioned spill data for a single hashtable. Contains the