diff options
author | Jeff Davis <jdavis@postgresql.org> | 2020-04-07 20:42:04 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2020-04-07 21:25:28 -0700 |
commit | 50a38f65177ea7858bc97f71ba0757ba04c1c167 (patch) | |
tree | 4268856dc26ff94aa955bef1a80577e884f09206 /src/backend/utils/adt/arrayfuncs.c | |
parent | f0705bb6286d8a24e08ddd99641264ba947ebd03 (diff) | |
download | postgresql-50a38f65177ea7858bc97f71ba0757ba04c1c167.tar.gz postgresql-50a38f65177ea7858bc97f71ba0757ba04c1c167.zip |
Create memory context for HashAgg with a reasonable maxBlockSize.
If the memory context's maxBlockSize is too big, a single block
allocation can suddenly exceed work_mem. For Hash Aggregation, this
can mean spilling to disk too early or reporting a confusing memory
usage number for EXPLAN ANALYZE.
Introduce CreateWorkExprContext(), which is like CreateExprContext(),
except that it creates the AllocSet with a maxBlockSize that is
reasonable in proportion to work_mem.
Right now, CreateWorkExprContext() is only used by Hash Aggregation,
but it may be generally useful in the future.
Discussion: https://postgr.es/m/412a3fbf306f84d8d78c4009e11791867e62b87c.camel@j-davis.com
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
0 files changed, 0 insertions, 0 deletions