postgresql/src/include/nodes
Tom Lane 08a823e53b Fix improper repetition of previous results from a hashed aggregate.
ExecReScanAgg's check for whether it could re-use a previously calculated
hashtable neglected the possibility that the Agg node might reference
PARAM_EXEC Params that are not referenced by its input plan node.  That's
okay if the Params are in upper tlist or qual expressions; but if one
appears in aggregate input expressions, then the hashtable contents need
to be recomputed when the Param's value changes.

To avoid unnecessary performance degradation in the case of a Param that
isn't within an aggregate input, add logic to the planner to determine
which Params are within aggregate inputs.  This requires a new field in
struct Agg, but fortunately we never write plans to disk, so this isn't
an initdb-forcing change.

Per report from Jeevan Chalke.  This has been broken since forever,
so back-patch to all supported branches.

Andrew Gierth, with minor adjustments by me

Report: <CAM2+6=VY8ykfLT5Q8vb9B6EbeBk-NGuLbT6seaQ+Fq4zXvrDcA@mail.gmail.com>
2016-08-24 14:37:51 -04:00
..
bitmapset.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
execnodes.h Ensure that RowExprs and whole-row Vars produce the expected column names. 2014-11-10 15:21:14 -05:00
makefuncs.h Fix CREATE MATVIEW/CREATE TABLE AS ... WITH NO DATA to not plan the query. 2016-06-27 15:57:21 -04:00
memnodes.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeFuncs.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodes.h Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE' 2014-08-21 19:12:00 -04:00
params.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
parsenodes.h Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE' 2014-08-21 19:12:00 -04:00
pg_list.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
plannodes.h Fix improper repetition of previous results from a hashed aggregate. 2016-08-24 14:37:51 -04:00
primnodes.h Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
print.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
readfuncs.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
relation.h Still more fixes for planner's handling of LATERAL references. 2015-12-11 14:22:20 -05:00
replnodes.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tidbitmap.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
value.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00