postgresql/src
Tom Lane 2ff82b6e67 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:47:29 -05:00
..
backend Repair memory leakage while ANALYZE-ing complex index expressions. 2010-11-09 11:47:29 -05:00
bin Translation updates for 8.2.18 2010-09-30 22:19:17 +03:00
include Tag 8.2.18 2010-10-01 10:37:09 -03:00
interfaces Fix ecpg test building process to not generate *.dSYM junk on Macs. 2010-10-20 00:55:15 -04:00
makefiles Add $(CFLAGS) to the simplified build rule for .so libraries on Darwin. 2006-11-28 05:45:43 +00:00
pl Fix plpgsql's handling of "simple" expression evaluation. 2010-10-28 13:01:23 -04:00
port Tag 8.2.18 2010-10-01 10:37:09 -03:00
template Make --with-ldap build on Unixware, per Olivier Prenant. 2006-12-14 21:50:07 +00:00
test Reduce recursion depth in recently-added regression test. 2010-11-03 13:42:19 -04:00
timezone Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:14 +02:00
tools Fix MSVC builds for recent plperl changes. Go back to version 8.2, which is 2010-05-13 21:34:55 +00:00
tutorial Fix some misuses of strncat(). 2006-09-27 16:19:42 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:14 +02:00
bcc32.mak Fix bcc32.mak to create and remove pg_config_os.h properly. Apparently 2006-10-06 18:53:53 +00:00
DEVELOPERS Testing commit stuff 2006-07-10 15:50:02 +00:00
Makefile Remove dllinit.c; it was only needed for long-obsolete Cygwin versions, 2006-06-22 23:50:35 +00:00
Makefile.global.in On Windows, we know the backend stack size limit because we have to 2006-10-08 17:15:34 +00:00
Makefile.shlib Fix shared library creation to work properly on AIX. Albe Laurenz 2006-09-19 15:36:08 +00:00
nls-global.mk When merging PO files, take into consideration translations in other PO 2006-04-05 13:40:15 +00:00
win32.mak Fix win32.mak for config cleanup. 2006-08-08 22:44:05 +00:00