]> granicus.if.org Git - postgresql/commit
Turn the rangetable used by the executor into a flat list, and avoid storing
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Feb 2007 22:00:26 +0000 (22:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Feb 2007 22:00:26 +0000 (22:00 +0000)
commiteab6b8b27eba54b8fd0ad3f64989d12200979c96
treeca4fad45c65c60b7900df6e373bd5999993ea2b1
parent849000c7823d604270094aea76fc530b6cfe9466
Turn the rangetable used by the executor into a flat list, and avoid storing
useless substructure for its RangeTblEntry nodes.  (I chose to keep using the
same struct node type and just zero out the link fields for unneeded info,
rather than making a separate ExecRangeTblEntry type --- it seemed too
fragile to have two different rangetable representations.)

Along the way, put subplans into a list in the toplevel PlannedStmt node,
and have SubPlan nodes refer to them by list index instead of direct pointers.
Vadim wanted to do that years ago, but I never understood what he was on about
until now.  It makes things a *whole* lot more robust, because we can stop
worrying about duplicate processing of subplans during expression tree
traversals.  That's been a constant source of bugs, and it's finally gone.

There are some consequent simplifications yet to be made, like not using
a separate EState for subplans in the executor, but I'll tackle that later.
32 files changed:
doc/src/sgml/indexam.sgml
src/backend/commands/explain.c
src/backend/executor/execMain.c
src/backend/executor/execUtils.c
src/backend/executor/nodeFunctionscan.c
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeSubqueryscan.c
src/backend/executor/nodeValuesscan.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/print.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planagg.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/relnode.c
src/backend/parser/parse_expr.c
src/backend/utils/adt/selfuncs.c
src/include/executor/executor.h
src/include/nodes/execnodes.h
src/include/nodes/plannodes.h
src/include/nodes/primnodes.h
src/include/nodes/print.h
src/include/nodes/relation.h
src/include/optimizer/cost.h
src/include/optimizer/planmain.h