summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2003-02-09 00:30:41 +0000
committerTom Lane2003-02-09 00:30:41 +0000
commit145014f81151a12ac6a0f8e299899c4f60e0f8c1 (patch)
tree669a8cecd8e2f67fae0966134b91a28df1e2a6e7 /src/include
parentc15a4c2aef3ca78a530778b735d43aa04d103ea6 (diff)
Make further use of new bitmapset code: executor's chgParam, extParam,
locParam lists can be converted to bitmapsets to speed updating. Also, replace 'locParam' with 'allParam', which contains all the paramIDs relevant to the node (i.e., the union of extParam and locParam); this saves a step during SetChangedParamList() without costing anything elsewhere.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/executor.h4
-rw-r--r--src/include/nodes/execnodes.h5
-rw-r--r--src/include/nodes/plannodes.h20
-rw-r--r--src/include/nodes/primnodes.h9
-rw-r--r--src/include/optimizer/subselect.h4
5 files changed, 25 insertions, 17 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 2f329ca57af..ee30f518969 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: executor.h,v 1.88 2003/02/03 15:07:07 tgl Exp $
+ * $Id: executor.h,v 1.89 2003/02/09 00:30:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -160,7 +160,7 @@ extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate);
extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate,
TupleDesc tupType);
extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid);
-extern void SetChangedParamList(PlanState *node, List *newchg);
+extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
typedef struct TupOutputState
{
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index ccb25320662..8d2b1305984 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.93 2003/02/03 21:15:44 tgl Exp $
+ * $Id: execnodes.h,v 1.94 2003/02/09 00:30:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
#include "executor/hashjoin.h"
#include "executor/tuptable.h"
#include "fmgr.h"
+#include "nodes/bitmapset.h"
#include "nodes/params.h"
#include "nodes/plannodes.h"
#include "utils/tuplestore.h"
@@ -616,7 +617,7 @@ typedef struct PlanState
/*
* State for management of parameter-change-driven rescanning
*/
- List *chgParam; /* integer list of IDs of changed Params */
+ Bitmapset *chgParam; /* set of IDs of changed Params */
/*
* Other run-time state needed by most if not all node types.
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 67a4d48782f..2ca16b63272 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: plannodes.h,v 1.63 2002/12/12 15:49:40 tgl Exp $
+ * $Id: plannodes.h,v 1.64 2003/02/09 00:30:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#define PLANNODES_H
#include "access/sdir.h"
+#include "nodes/bitmapset.h"
#include "nodes/primnodes.h"
@@ -65,14 +66,17 @@ typedef struct Plan
/*
* Information for management of parameter-change-driven rescanning
+ *
+ * extParam includes the paramIDs of all external PARAM_EXEC params
+ * affecting this plan node or its children. setParam params from
+ * the node's initPlans are not included, but their extParams are.
+ *
+ * allParam includes all the extParam paramIDs, plus the IDs of local
+ * params that affect the node (i.e., the setParams of its initplans).
+ * These are _all_ the PARAM_EXEC params that affect this node.
*/
- List *extParam; /* indices of _all_ _external_ PARAM_EXEC
- * for this plan in global
- * es_param_exec_vals. Params from
- * setParam from initPlan-s are not
- * included, but their execParam-s are
- * here!!! */
- List *locParam; /* someones from setParam-s */
+ Bitmapset *extParam;
+ Bitmapset *allParam;
/*
* We really need in some TopPlan node to store range table and
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index ad1c7361255..be917c4f260 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: primnodes.h,v 1.78 2003/02/03 21:15:44 tgl Exp $
+ * $Id: primnodes.h,v 1.79 2003/02/09 00:30:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -435,9 +435,11 @@ typedef struct SubLink
* expressions to be evaluated in the outer-query context (currently these
* args are always just Vars, but in principle they could be any expression).
* The values are assigned to the global PARAM_EXEC params indexed by parParam
- * (the parParam and args lists must have the same length). setParam is a
+ * (the parParam and args lists must have the same ordering). setParam is a
* list of the PARAM_EXEC params that are computed by the sub-select, if it
- * is an initplan.
+ * is an initplan; they are listed in order by sub-select output column
+ * position. (parParam and setParam are integer Lists, not Bitmapsets,
+ * because their ordering is significant.)
*/
typedef struct SubPlan
{
@@ -449,6 +451,7 @@ typedef struct SubPlan
/* The combining operators, transformed to executable expressions: */
List *exprs; /* list of OpExpr expression trees */
List *paramIds; /* IDs of Params embedded in the above */
+ /* Note: paramIds has a one-to-one correspondence to the exprs list */
/* The subselect, transformed to a Plan: */
struct Plan *plan; /* subselect plan itself */
int plan_id; /* dummy thing because of we haven't equal
diff --git a/src/include/optimizer/subselect.h b/src/include/optimizer/subselect.h
index 2e6a4640684..9dce88e0a8d 100644
--- a/src/include/optimizer/subselect.h
+++ b/src/include/optimizer/subselect.h
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: subselect.h,v 1.17 2003/01/20 18:55:05 tgl Exp $
+ * $Id: subselect.h,v 1.18 2003/02/09 00:30:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -22,6 +22,6 @@ extern int PlannerPlanId; /* to assign unique ID to subquery plans */
extern Node *convert_IN_to_join(Query *parse, SubLink *sublink);
extern Node *SS_replace_correlation_vars(Node *expr);
extern Node *SS_process_sublinks(Node *expr, bool isQual);
-extern List *SS_finalize_plan(Plan *plan, List *rtable);
+extern void SS_finalize_plan(Plan *plan, List *rtable);
#endif /* SUBSELECT_H */