*** pgsql/src/backend/executor/nodeBitmapIndexscan.c 2008/01/01 19:45:49 1.25 --- pgsql/src/backend/executor/nodeBitmapIndexscan.c 2008/04/10 22:25:25 1.26 *************** *** 8,14 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.24 2007/11/15 21:14:34 momjian Exp $ * *------------------------------------------------------------------------- */ --- 8,14 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.25 2008/01/01 19:45:49 momjian Exp $ * *------------------------------------------------------------------------- */ *************** *** 37,47 **** Node * MultiExecBitmapIndexScan(BitmapIndexScanState *node) { - #define MAX_TIDS 1024 TIDBitmap *tbm; IndexScanDesc scandesc; - ItemPointerData tids[MAX_TIDS]; - int32 ntids; double nTuples = 0; bool doscan; --- 37,44 ---- *************** MultiExecBitmapIndexScan(BitmapIndexScan *** 91,113 **** */ while (doscan) { ! bool more = index_getmulti(scandesc, tids, MAX_TIDS, &ntids); ! ! if (ntids > 0) ! { ! tbm_add_tuples(tbm, tids, ntids); ! nTuples += ntids; ! } CHECK_FOR_INTERRUPTS(); ! if (!more) ! { ! doscan = ExecIndexAdvanceArrayKeys(node->biss_ArrayKeys, ! node->biss_NumArrayKeys); ! if (doscan) /* reset index scan */ ! index_rescan(node->biss_ScanDesc, node->biss_ScanKeys); ! } } /* must provide our own instrumentation support */ --- 88,101 ---- */ while (doscan) { ! nTuples += (double) index_getbitmap(scandesc, tbm); CHECK_FOR_INTERRUPTS(); ! doscan = ExecIndexAdvanceArrayKeys(node->biss_ArrayKeys, ! node->biss_NumArrayKeys); ! if (doscan) /* reset index scan */ ! index_rescan(node->biss_ScanDesc, node->biss_ScanKeys); } /* must provide our own instrumentation support */ *************** ExecInitBitmapIndexScan(BitmapIndexScan *** 321,330 **** * Initialize scan descriptor. */ indexstate->biss_ScanDesc = ! index_beginscan_multi(indexstate->biss_RelationDesc, ! estate->es_snapshot, ! indexstate->biss_NumScanKeys, ! indexstate->biss_ScanKeys); /* * all done. --- 309,318 ---- * Initialize scan descriptor. */ indexstate->biss_ScanDesc = ! index_beginscan_bitmap(indexstate->biss_RelationDesc, ! estate->es_snapshot, ! indexstate->biss_NumScanKeys, ! indexstate->biss_ScanKeys); /* * all done.