合入PR: Bitmap Index Scan optimization,使用宏和模板重构bitmap使用的hashtable

This commit is contained in:
yyl164119487
2023-03-01 19:30:09 -08:00
parent 2f380bcdb0
commit 93b27dc49f
22 changed files with 1808 additions and 265 deletions

View File

@ -258,6 +258,7 @@ static TupleTableSlot* BitmapHeapTblNext(BitmapHeapScanState* node)
ExprContext* econtext = NULL;
TableScanDesc scan = NULL;
TIDBitmap* tbm = NULL;
TBMHandler tbm_handler;
TBMIterator* tbmiterator = NULL;
TBMIterateResult* tbmres = NULL;
HBktTblScanDesc hpscan = NULL;
@ -301,6 +302,7 @@ static TupleTableSlot* BitmapHeapTblNext(BitmapHeapScanState* node)
*/
if (tbm == NULL) {
tbm = (TIDBitmap*)MultiExecProcNode(outerPlanState(node));
tbm_handler = tbm_get_handler(tbm);
if (tbm == NULL || !IsA(tbm, TIDBitmap)) {
ereport(ERROR,
@ -310,12 +312,12 @@ static TupleTableSlot* BitmapHeapTblNext(BitmapHeapScanState* node)
}
node->tbm = tbm;
node->tbmiterator = tbmiterator = tbm_begin_iterate(tbm);
node->tbmiterator = tbmiterator = tbm_handler._begin_iterate(tbm);
node->tbmres = tbmres = NULL;
#ifdef USE_PREFETCH
if (u_sess->storage_cxt.target_prefetch_pages > 0) {
node->prefetch_iterator = prefetch_iterator = tbm_begin_iterate(tbm);
node->prefetch_iterator = prefetch_iterator = tbm_handler._begin_iterate(tbm);
node->prefetch_pages = 0;
node->prefetch_target = -1;
}