aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2021-09-21 01:14:11 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2021-09-23 18:22:29 +0200
commitbb7628e55eda6f450f0f824d11c9a34b11f6bb12 (patch)
tree1485113757636ce19e485f0e68d8878566a4673b /src/backend/access/gist
parent9eff8593265929d3a1fcdee375bd0a801c12b367 (diff)
downloadpostgresql-bb7628e55eda6f450f0f824d11c9a34b11f6bb12.tar.gz
postgresql-bb7628e55eda6f450f0f824d11c9a34b11f6bb12.zip
Free memory after building each statistics object
Until now, all extended statistics on a given relation were built in the same memory context, without resetting. Some of the memory was released explicitly, but not all of it - for example memory allocated while detoasting values is hard to free. This is how it worked since extended statistics were introduced in PostgreSQL 10, but adding support for extended stats on expressions made the issue somewhat worse as it increases the number of statistics to build. Fixed by adding a memory context which gets reset after building each statistics object (all the statistics kinds included in it). Resetting it after building each statistics kind would be even better, but it would require more invasive changes and copying of results, making it harder to backpatch. Backpatch to PostgreSQL 10, where extended statistics were introduced. Author: Justin Pryzby Reported-by: Justin Pryzby Reviewed-by: Tomas Vondra Backpatch-through: 10 Discussion: https://www.postgresql.org/message-id/20210915200928.GP831%40telsasoft.com
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions