1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-03 09:13:20 +03:00

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.
This commit is contained in:
Tom Lane
2007-02-20 17:32:18 +00:00
parent 71b0cf2f6b
commit 9cbd0c155d
39 changed files with 1172 additions and 897 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.195 2007/02/19 07:03:31 tgl Exp $
* $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.196 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -141,6 +141,7 @@ typedef enum NodeTag
T_RangeTblRef,
T_JoinExpr,
T_FromExpr,
T_IntoClause,
/*
* TAGS FOR EXPRESSION STATE NODES (execnodes.h)
@@ -225,9 +226,10 @@ typedef enum NodeTag
T_OidList,
/*
* TAGS FOR PARSE TREE NODES (parsenodes.h)
* TAGS FOR STATEMENT NODES (mostly in parsenodes.h)
*/
T_Query = 700,
T_PlannedStmt,
T_InsertStmt,
T_DeleteStmt,
T_UpdateStmt,
@@ -302,8 +304,12 @@ typedef enum NodeTag
T_AlterOwnerStmt,
T_DropOwnedStmt,
T_ReassignOwnedStmt,
T_CompositeTypeStmt,
T_A_Expr = 800,
/*
* TAGS FOR PARSE TREE NODES (parsenodes.h)
*/
T_A_Expr = 900,
T_ColumnRef,
T_ParamRef,
T_A_Const,
@@ -328,7 +334,6 @@ typedef enum NodeTag
T_FuncWithArgs,
T_PrivTarget,
T_CreateOpClassItem,
T_CompositeTypeStmt,
T_InhRelation,
T_FunctionParameter,
T_LockingClause,
@@ -343,7 +348,7 @@ typedef enum NodeTag
* purposes (usually because they are involved in APIs where we want to
* pass multiple object types through the same pointer).
*/
T_TriggerData = 900, /* in commands/trigger.h */
T_TriggerData = 950, /* in commands/trigger.h */
T_ReturnSetInfo, /* in nodes/execnodes.h */
T_TIDBitmap /* in nodes/tidbitmap.h */
} NodeTag;
@@ -430,10 +435,9 @@ typedef double Cost; /* execution cost (in page-access units) */
/*
* CmdType -
* enums for type of operation represented by a Query
* enums for type of operation represented by a Query or PlannedStmt
*
* ??? could have put this in parsenodes.h but many files not in the
* optimizer also need this...
* This is needed in both parsenodes.h and plannodes.h, so put it here...
*/
typedef enum CmdType
{