aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2017-07-12 22:03:38 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2017-07-12 22:06:13 +0300
commitda11977de9c685ef808d3a293727f9ce26753ec4 (patch)
treeeea53c3ea5369db5ebb489e3133f7c234c102b62 /src/backend/utils/adt/ruleutils.c
parentca793c59a51e94cedf8cbea5c29668bf8fa298f3 (diff)
downloadpostgresql-da11977de9c685ef808d3a293727f9ce26753ec4.tar.gz
postgresql-da11977de9c685ef808d3a293727f9ce26753ec4.zip
Reduce memory usage of tsvector type analyze function.
compute_tsvector_stats() detoasted and kept in memory every tsvector value in the sample, but that can be a lot of memory. The original bug report described a case using over 10 gigabytes, with statistics target of 10000 (the maximum). To fix, allocate a separate copy of just the lexemes that we keep around, and free the detoasted tsvector values as we go. This adds some palloc/pfree overhead, when you have a lot of distinct lexemes in the sample, but it's better than running out of memory. Fixes bug #14654 reported by James C. Reviewed by Tom Lane. Backport to all supported versions. Discussion: https://www.postgresql.org/message-id/20170514200602.1451.46797@wrigleys.postgresql.org
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
0 files changed, 0 insertions, 0 deletions