pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Reduce memory usage of tsvector type analyze function. 6+ messages / 1 participants [nested] [flat]
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bbeec3c749bcbd9b75fc1f036979fed516f9a2c8 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_2_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/40ba61b447829a328963f5a868b291ecb24762d6 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/da11977de9c685ef808d3a293727f9ce26753ec4 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/11854dee01e582e83d87fc2b3a5316f2d44852b3 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/852902822e04f842244aaf67f2e7fede23f5b6b0 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce memory usage of tsvector type analyze function. @ 2017-07-12 19:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 6+ messages in thread From: Heikki Linnakangas @ 2017-07-12 19:06 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/209970ded835ffe2f354220da77f3df9a7a7dab4 Modified Files -------------- src/backend/tsearch/ts_typanalyze.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2017-07-12 19:06 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2017-07-12 19:06 pgsql: Reduce memory usage of tsvector type analyze function. Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox