Skip to content

Commit

Permalink
Allocate DatumHashTable in ANALYZE memory context
Browse files Browse the repository at this point in the history
Instead of allocating under TopMemoryContext, we allocate it under
VacAttrStats->anl_context now.

Reviewed-by: Ashwin Agrawal <aashwin@vmware.com>
(cherry picked from commit b88beeb)
  • Loading branch information
soumyadeep2007 committed May 24, 2024
1 parent 41fcb15 commit 5c881ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/commands/analyzeutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ createDatumHashTable(unsigned int nEntries)
hash_ctl.entrysize = sizeof(MCVFreqEntry);
hash_ctl.hash = datumHashTableHash;
hash_ctl.match = datumHashTableMatch;
hash_ctl.hcxt = CurrentMemoryContext; /* VacAttrStats->anl_context */

return hash_create("DatumHashTable", nEntries, &hash_ctl,
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE);
Expand Down

0 comments on commit 5c881ab

Please # to comment.