postgresql/src/include/nodes
David Rowley f58b230ed0 Cache if PathTarget and RestrictInfos contain volatile functions
Here we aim to reduce duplicate work done by contain_volatile_functions()
by caching whether PathTargets and RestrictInfos contain any volatile
functions the first time contain_volatile_functions() is called for them.
Any future calls for these nodes just use the cached value rather than
going to the trouble of recursively checking the sub-node all over again.
Thanks to Tom Lane for the idea.

Any locations in the code which make changes to a PathTarget or
RestrictInfo which could change the outcome of the volatility check must
change the cached value back to VOLATILITY_UNKNOWN again.
contain_volatile_functions() is the only code in charge of setting the
cache value to either VOLATILITY_VOLATILE or VOLATILITY_NOVOLATILE.

Some existing code does benefit from this additional caching, however,
this change is mainly aimed at an upcoming patch that must check for
volatility during the join search.  Repeated volatility checks in that
case can become very expensive when the join search contains more than a
few relations.

Author: David Rowley
Discussion: https://postgr.es/m/3795226.1614059027@sss.pgh.pa.us
2021-03-29 14:55:26 +13:00
..
bitmapset.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execnodes.h Add TID Range Scans to support efficient scanning ranges of TIDs 2021-02-27 22:59:36 +13:00
extensible.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
lockoptions.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
makefuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
memnodes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeFuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes.h Extended statistics on expressions 2021-03-27 00:01:11 +01:00
params.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
parsenodes.h Extended statistics on expressions 2021-03-27 00:01:11 +01:00
pathnodes.h Cache if PathTarget and RestrictInfos contain volatile functions 2021-03-29 14:55:26 +13:00
pg_list.h Implement GROUP BY DISTINCT 2021-03-18 18:22:18 +01:00
plannodes.h Revert "Enable parallel SELECT for "INSERT INTO ... SELECT ..."." 2021-03-24 11:29:15 +05:30
primnodes.h Re-implement pl/pgsql's expression and assignment parsing. 2021-01-04 11:52:00 -05:00
print.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
readfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
replnodes.h Add option to enable two_phase commits via pg_create_logical_replication_slot. 2021-03-03 07:34:11 +05:30
subscripting.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
supportnodes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tidbitmap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
value.h Update copyright for 2021 2021-01-02 13:06:25 -05:00