1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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.
This commit is contained in:
Tom Lane
2005-04-20 15:48:36 +00:00
parent de4fbfadc5
commit 9d64632144
4 changed files with 65 additions and 17 deletions

View File

@ -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;