postgresql/src/backend/executor
Bruce Momjian 603e153bb8 I don't like last minute patches before the final freeze, but I believe that
this one could be useful for people experiencing out-of-memory crashes while
executing queries which retrieve or use a very large number of tuples.

The problem happens when storage is allocated for functions results used in
a large query, for example:

  select upper(name) from big_table;
  select big_table.array[1] from big_table;
  select count(upper(name)) from big_table;

This patch is a dirty hack that fixes the out-of-memory problem for the most
common cases, like the above ones. It is not the final solution for the
problem but it can work for some people, so I'm posting it.

The patch should be safe because all changes are under #ifdef. Furthermore
the feature can be enabled or disabled at runtime by the `free_tuple_memory'
options in the pg_options file. The option is disabled by default and must
be explicitly enabled at runtime to have any effect.

To enable the patch add the follwing line to Makefile.custom:

CUSTOM_COPT += -DFREE_TUPLE_MEMORY

To enable the option at runtime add the following line to pg_option:

free_tuple_memory=1

Massimo
1999-06-12 14:05:41 +00:00
..
_deadcode Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
execAmi.c pgindent run over code. 1999-05-25 16:15:34 +00:00
execFlatten.c Fix typo in comment. 1999-02-23 07:33:09 +00:00
execJunk.c Change resjunk to a boolean. 1999-05-17 17:03:51 +00:00
execMain.c Reset evaluation plan tuple table next free slot counter to 0 1999-06-09 12:23:42 +00:00
execProcnode.c Remove Tee code, move to _deadcode. 1999-03-23 16:51:04 +00:00
execQual.c Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
execScan.c Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
execTuples.c pgindent run over code. 1999-05-25 16:15:34 +00:00
execUtils.c pgindent run over code. 1999-05-25 16:15:34 +00:00
functions.c pgindent run over code. 1999-05-25 16:15:34 +00:00
Makefile Remove Tee code, move to _deadcode. 1999-03-23 16:51:04 +00:00
nodeAgg.c I don't like last minute patches before the final freeze, but I believe that 1999-06-12 14:05:41 +00:00
nodeAppend.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeGroup.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeHash.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeHashjoin.c Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
nodeIndexscan.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeMaterial.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeMergejoin.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeNestloop.c Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
nodeResult.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeSeqscan.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeSort.c Ensure consistent results when FormSortKeys fails to find 1999-06-03 03:17:37 +00:00
nodeSubplan.c pgindent run over code. 1999-05-25 16:15:34 +00:00
nodeUnique.c Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
spi.c Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00