Thread: pgsql: Remove the Query structure from the executor's API.
Log Message: ----------- 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. Modified Files: -------------- pgsql/src/backend/commands: copy.c (r1.275 -> r1.276) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/copy.c.diff?r1=1.275&r2=1.276) explain.c (r1.155 -> r1.156) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c.diff?r1=1.155&r2=1.156) portalcmds.c (r1.60 -> r1.61) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c.diff?r1=1.60&r2=1.61) prepare.c (r1.68 -> r1.69) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.68&r2=1.69) pgsql/src/backend/executor: execMain.c (r1.286 -> r1.287) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execMain.c.diff?r1=1.286&r2=1.287) execUtils.c (r1.144 -> r1.145) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c.diff?r1=1.144&r2=1.145) functions.c (r1.110 -> r1.111) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c.diff?r1=1.110&r2=1.111) spi.c (r1.169 -> r1.170) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c.diff?r1=1.169&r2=1.170) pgsql/src/backend/nodes: copyfuncs.c (r1.366 -> r1.367) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c.diff?r1=1.366&r2=1.367) equalfuncs.c (r1.298 -> r1.299) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c.diff?r1=1.298&r2=1.299) outfuncs.c (r1.299 -> r1.300) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c.diff?r1=1.299&r2=1.300) readfuncs.c (r1.202 -> r1.203) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c.diff?r1=1.202&r2=1.203) pgsql/src/backend/optimizer/path: allpaths.c (r1.159 -> r1.160) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/allpaths.c.diff?r1=1.159&r2=1.160) pgsql/src/backend/optimizer/plan: planagg.c (r1.27 -> r1.28) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c.diff?r1=1.27&r2=1.28) planner.c (r1.213 -> r1.214) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.213&r2=1.214) pgsql/src/backend/parser: analyze.c (r1.360 -> r1.361) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.360&r2=1.361) gram.y (r2.579 -> r2.580) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y.diff?r1=2.579&r2=2.580) pgsql/src/backend/tcop: postgres.c (r1.524 -> r1.525) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c.diff?r1=1.524&r2=1.525) pquery.c (r1.113 -> r1.114) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/pquery.c.diff?r1=1.113&r2=1.114) utility.c (r1.272 -> r1.273) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/utility.c.diff?r1=1.272&r2=1.273) pgsql/src/backend/utils/mmgr: portalmem.c (r1.98 -> r1.99) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/portalmem.c.diff?r1=1.98&r2=1.99) pgsql/src/include/catalog: catversion.h (r1.387 -> r1.388) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h.diff?r1=1.387&r2=1.388) pgsql/src/include/commands: portalcmds.h (r1.20 -> r1.21) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/portalcmds.h.diff?r1=1.20&r2=1.21) prepare.h (r1.23 -> r1.24) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/prepare.h.diff?r1=1.23&r2=1.24) pgsql/src/include/executor: execdesc.h (r1.33 -> r1.34) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/execdesc.h.diff?r1=1.33&r2=1.34) executor.h (r1.136 -> r1.137) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h.diff?r1=1.136&r2=1.137) spi_priv.h (r1.26 -> r1.27) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi_priv.h.diff?r1=1.26&r2=1.27) pgsql/src/include/nodes: execnodes.h (r1.167 -> r1.168) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.167&r2=1.168) nodes.h (r1.195 -> r1.196) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/nodes.h.diff?r1=1.195&r2=1.196) parsenodes.h (r1.340 -> r1.341) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h.diff?r1=1.340&r2=1.341) plannodes.h (r1.90 -> r1.91) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/plannodes.h.diff?r1=1.90&r2=1.91) primnodes.h (r1.125 -> r1.126) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/primnodes.h.diff?r1=1.125&r2=1.126) relation.h (r1.136 -> r1.137) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h.diff?r1=1.136&r2=1.137) pgsql/src/include/optimizer: planner.h (r1.37 -> r1.38) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planner.h.diff?r1=1.37&r2=1.38) pgsql/src/include/tcop: pquery.h (r1.40 -> r1.41) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/pquery.h.diff?r1=1.40&r2=1.41) tcopprot.h (r1.86 -> r1.87) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/tcopprot.h.diff?r1=1.86&r2=1.87) utility.h (r1.30 -> r1.31) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/utility.h.diff?r1=1.30&r2=1.31) pgsql/src/include/utils: portal.h (r1.72 -> r1.73) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/portal.h.diff?r1=1.72&r2=1.73) pgsql/src/pl/plpgsql/src: pl_exec.c (r1.188 -> r1.189) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c.diff?r1=1.188&r2=1.189)