diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-20 15:48:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-20 15:48:36 +0000 |
commit | 9d64632144034cd6b0a32bad1c3a305008149754 (patch) | |
tree | 3ffabef3865521ea9a6e48e7e2213c369ff01abc /src/backend/executor/nodeBitmapAnd.c | |
parent | de4fbfadc50efe16cc05ea929bf5b408143d23fa (diff) | |
download | postgresql-9d64632144034cd6b0a32bad1c3a305008149754.tar.gz postgresql-9d64632144034cd6b0a32bad1c3a305008149754.zip |
Minor performance improvement: avoid unnecessary creation/unioning of
bitmaps for multiple indexscans. Instead just let each indexscan add
TIDs directly into the BitmapOr node's result bitmap.
Diffstat (limited to 'src/backend/executor/nodeBitmapAnd.c')
-rw-r--r-- | src/backend/executor/nodeBitmapAnd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/executor/nodeBitmapAnd.c b/src/backend/executor/nodeBitmapAnd.c index 4af1624012b..1d5d94fc3f8 100644 --- a/src/backend/executor/nodeBitmapAnd.c +++ b/src/backend/executor/nodeBitmapAnd.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapAnd.c,v 1.1 2005/04/19 22:35:12 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapAnd.c,v 1.2 2005/04/20 15:48:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -46,6 +46,7 @@ ExecInitBitmapAnd(BitmapAnd *node, EState *estate) PlanState **bitmapplanstates; int nplans; int i; + ListCell *l; Plan *initNode; CXT1_printf("ExecInitBitmapAnd: context is %d\n", CurrentMemoryContext); @@ -78,10 +79,12 @@ ExecInitBitmapAnd(BitmapAnd *node, EState *estate) * call ExecInitNode on each of the plans to be executed and save the * results into the array "bitmapplanstates". */ - for (i = 0; i < nplans; i++) + i = 0; + foreach(l, node->bitmapplans) { - initNode = (Plan *) list_nth(node->bitmapplans, i); + initNode = (Plan *) lfirst(l); bitmapplanstates[i] = ExecInitNode(initNode, estate); + i++; } return bitmapandstate; |