diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-02-09 00:30:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-02-09 00:30:41 +0000 |
commit | 145014f81151a12ac6a0f8e299899c4f60e0f8c1 (patch) | |
tree | 669a8cecd8e2f67fae0966134b91a28df1e2a6e7 /src/backend/executor/execUtils.c | |
parent | c15a4c2aef3ca78a530778b735d43aa04d103ea6 (diff) | |
download | postgresql-145014f81151a12ac6a0f8e299899c4f60e0f8c1.tar.gz postgresql-145014f81151a12ac6a0f8e299899c4f60e0f8c1.zip |
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/backend/executor/execUtils.c')
-rw-r--r-- | src/backend/executor/execUtils.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index 90bd8adf1ae..b2fe0a2276a 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.96 2003/01/23 05:10:39 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.97 2003/02/09 00:30:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -874,25 +874,28 @@ ExecInsertIndexTuples(TupleTableSlot *slot, } } +/* + * UpdateChangedParamSet + * Add changed parameters to a plan node's chgParam set + */ void -SetChangedParamList(PlanState *node, List *newchg) +UpdateChangedParamSet(PlanState *node, Bitmapset *newchg) { - List *nl; - - foreach(nl, newchg) - { - int paramId = lfirsti(nl); + Bitmapset *parmset; - /* if this node doesn't depend on a param ... */ - if (!intMember(paramId, node->plan->extParam) && - !intMember(paramId, node->plan->locParam)) - continue; - /* if this param is already in list of changed ones ... */ - if (intMember(paramId, node->chgParam)) - continue; - /* else - add this param to the list */ - node->chgParam = lappendi(node->chgParam, paramId); - } + /* + * The plan node only depends on params listed in its allParam set. + * Don't include anything else into its chgParam set. + */ + parmset = bms_intersect(node->plan->allParam, newchg); + /* + * Keep node->chgParam == NULL if there's not actually any members; + * this allows the simplest possible tests in executor node files. + */ + if (!bms_is_empty(parmset)) + node->chgParam = bms_join(node->chgParam, parmset); + else + bms_free(parmset); } /* |