postgresql/src
Tom Lane f0e4331d04 Repair memory leakage while ANALYZE-ing complex index expressions.
The general design of memory management in Postgres is that intermediate
results computed by an expression are not freed until the end of the tuple
cycle.  For expression indexes, ANALYZE has to re-evaluate each expression
for each of its sample rows, and it wasn't bothering to free intermediate
results until the end of processing of that index.  This could lead to very
substantial leakage if the intermediate results were large, as in a recent
example from Jakub Ouhrabka.  Fix by doing ResetExprContext for each sample
row.  This necessitates adding a datumCopy step to ensure that the final
expression value isn't recycled too.  Some quick testing suggests that this
change adds at worst about 10% to the time needed to analyze a table with
an expression index; which is annoying, but seems a tolerable price to pay
to avoid unexpected out-of-memory problems.

Back-patch to all supported branches.
2010-11-09 11:56:23 -05:00
..
backend Repair memory leakage while ANALYZE-ing complex index expressions. 2010-11-09 11:56:23 -05:00
bin Translation updates for 8.4.5 2010-09-30 23:31:19 +03:00
include Tag 8.4.5 2010-10-01 10:35:31 -03:00
interfaces Fix ecpg test building process to not generate *.dSYM junk on Macs. 2010-10-20 00:55:07 -04:00
makefiles Allow out-of-tree builds on mingw and cygwin 2009-01-05 09:27:20 +00:00
pl Fix plpgsql's handling of "simple" expression evaluation. 2010-10-28 13:02:53 -04:00
port Tag 8.4.5 2010-10-01 10:35:31 -03:00
template Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running 2009-02-11 20:02:40 +00:00
test Reduce recursion depth in recently-added regression test. 2010-11-03 13:42:04 -04:00
timezone Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:08 +02:00
tools Remove excess argument to open(2). 2010-10-02 18:40:57 -04:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:06 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:08 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Add the possibility to specify an explicit validator function for foreign-data 2009-02-24 10:06:36 +00:00
Makefile.global.in Fix the makefiles to fail cleanly if Perl is needed but not present. This 2009-06-23 03:46:00 +00:00
Makefile.shlib Allow out-of-tree builds on mingw and cygwin 2009-01-05 09:27:20 +00:00
nls-global.mk Do not msgmerge against /dev/null; merge against the pot file itself 2009-01-20 09:58:50 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00