Remove the Query structure from the executor's API. This allows us to stop

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

Commit: 9cbd0c155d1602aad879f510256b626c58942080
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2007-02-20T17:32:18Z
Releases: 8.3.0
Remove the Query structure from the executor's API.  This allows us to stop
storing mostly-redundant Query trees in prepared statements, portals, etc.
To replace Query, a new node type called PlannedStmt is inserted by the
planner at the top of a completed plan tree; this carries just the fields of
Query that are still needed at runtime.  The statement lists kept in portals
etc. now consist of intermixed PlannedStmt and bare utility-statement nodes
--- no Query.  This incidentally allows us to remove some fields from Query
and Plan nodes that shouldn't have been there in the first place.

Still to do: simplify the execution-time range table; at the moment the
range table passed to the executor still contains Query trees for subqueries.

initdb forced due to change of stored rules.

Files

PathChange+/−
src/backend/commands/copy.c modified +5 −4
src/backend/commands/explain.c modified +7 −6
src/backend/commands/portalcmds.c modified +4 −6
src/backend/commands/prepare.c modified +91 −95
src/backend/executor/execMain.c modified +72 −82
src/backend/executor/execUtils.c modified +2 −2
src/backend/executor/functions.c modified +29 −21
src/backend/executor/spi.c modified +67 −82
src/backend/nodes/copyfuncs.c modified +45 −14
src/backend/nodes/equalfuncs.c modified +16 −13
src/backend/nodes/outfuncs.c modified +37 −11
src/backend/nodes/readfuncs.c modified +17 −6
src/backend/optimizer/path/allpaths.c modified +4 −4
src/backend/optimizer/plan/planagg.c modified +2 −3
src/backend/optimizer/plan/planner.c modified +43 −23
src/backend/parser/analyze.c modified +7 −18
src/backend/parser/gram.y modified +36 −23
src/backend/tcop/postgres.c modified +74 −76
src/backend/tcop/pquery.c modified +220 −118
src/backend/tcop/utility.c modified +182 −128
src/backend/utils/mmgr/portalmem.c modified +32 −21
src/include/catalog/catversion.h modified +2 −2
src/include/commands/portalcmds.h modified +2 −1
src/include/commands/prepare.h modified +10 −6
src/include/executor/execdesc.h modified +15 −6
src/include/executor/executor.h modified +2 −1
src/include/executor/spi_priv.h modified +6 −5
src/include/nodes/execnodes.h modified +2 −2
src/include/nodes/nodes.h modified +12 −8
src/include/nodes/parsenodes.h modified +10 −52
src/include/nodes/plannodes.h modified +43 −10
src/include/nodes/primnodes.h modified +24 −1
src/include/nodes/relation.h modified +5 −1
src/include/optimizer/planner.h modified +3 −3
src/include/tcop/pquery.h modified +5 −2
src/include/tcop/tcopprot.h modified +3 −2
src/include/tcop/utility.h modified +2 −8
src/include/utils/portal.h modified +7 −9
src/pl/plpgsql/src/pl_exec.c modified +17 −12