postgresql/src
Heikki Linnakangas bbeec3c749 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
2017-07-12 22:06:10 +03:00
..
backend Reduce memory usage of tsvector type analyze function. 2017-07-12 22:06:10 +03:00
bin Remove unnecessary braces, to match the surrounding style. 2017-07-12 12:31:14 +03:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Restore psql's SIGPIPE setting if popen() fails. 2016-12-07 12:39:24 -05:00
include Fix leaking of small spilled subtransactions during logical decoding. 2017-06-18 19:13:15 -07:00
interfaces Second try at fixing tcp_keepalives_idle option on Solaris. 2017-06-28 12:30:16 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:56 -04:00
pl Translation updates 2017-05-08 10:10:54 -04:00
port Stamp 9.6.3. 2017-05-08 17:15:12 -04:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test commit_ts test: Set node name in test 2017-07-12 14:39:44 -04:00
timezone Fix new warnings from GCC 7 2017-05-16 08:52:39 -04:00
tools Take PROVE_FLAGS from the command line but not the environment 2017-06-10 10:22:14 -04:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Take PROVE_FLAGS from the command line but not the environment 2017-06-10 10:22:14 -04:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:15 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00