Restructure handling of inheritance queries so that they work with outer

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 6543d81d659f4176c6530fb09eef83deede264a0
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2000-11-12T00:37:02Z
Releases: 7.1.1
Restructure handling of inheritance queries so that they work with outer
joins, and clean things up a good deal at the same time.  Append plan node
no longer hacks on rangetable at runtime --- instead, all child tables are
given their own RT entries during planning.  Concept of multiple target
tables pushed up into execMain, replacing bug-prone implementation within
nodeAppend.  Planner now supports generating Append plans for inheritance
sets either at the top of the plan (the old way) or at the bottom.  Expanding
at the bottom is appropriate for tables used as sources, since they may
appear inside an outer join; but we must still expand at the top when the
target of an UPDATE or DELETE is an inheritance set, because we actually need
a different targetlist and junkfilter for each target table in that case.
Fortunately a target table can't be inside an outer join...  Bizarre mutual
recursion between union_planner and prepunion.c is gone --- in fact,
union_planner doesn't really have much to do with union queries anymore,
so I renamed it grouping_planner.

Files

PathChange+/−
src/backend/commands/command.c modified +4 −16
src/backend/commands/copy.c modified +13 −14
src/backend/commands/explain.c modified +1 −15
src/backend/executor/execMain.c modified +212 −164
src/backend/executor/execQual.c modified +1 −2
src/backend/executor/execTuples.c modified +5 −15
src/backend/executor/execUtils.c modified +19 −21
src/backend/executor/functions.c modified +1 −2
src/backend/executor/nodeAppend.c modified +19 −175
src/backend/executor/nodeSeqscan.c modified +1 −3
src/backend/nodes/copyfuncs.c modified +31 −3
src/backend/nodes/equalfuncs.c modified +16 −27
src/backend/nodes/outfuncs.c modified +31 −30
src/backend/nodes/readfuncs.c modified +47 −57
src/backend/optimizer/path/allpaths.c modified +158 −33
src/backend/optimizer/path/pathkeys.c modified +3 −3
src/backend/optimizer/plan/createplan.c modified +230 −162
src/backend/optimizer/plan/planmain.c modified +14 −6
src/backend/optimizer/plan/planner.c modified +86 −83
src/backend/optimizer/prep/prepunion.c modified +165 −308
src/backend/optimizer/README modified +11 −10
src/backend/optimizer/util/pathnode.c modified +32 −1
src/backend/optimizer/util/relnode.c modified +25 −5
src/backend/parser/parse_clause.c modified +6 −2
src/backend/tcop/pquery.c modified +6 −3
src/include/catalog/catversion.h modified +3 −3
src/include/executor/executor.h modified +4 −4
src/include/executor/tuptable.h modified +1 −2
src/include/nodes/execnodes.h modified +38 −47
src/include/nodes/nodes.h modified +4 −3
src/include/nodes/parsenodes.h modified +11 −1
src/include/nodes/plannodes.h modified +13 −11
src/include/nodes/relation.h modified +23 −1
src/include/optimizer/pathnode.h modified +3 −1
src/include/optimizer/planmain.h modified +2 −2
src/include/optimizer/planner.h modified +1 −2
src/include/optimizer/prep.h modified +7 −5