Skip to content

Commit 305f108

Browse files
knizhniktristan957
authored andcommitted
Fix bitmap scan prefetch (#260)
1 parent 9336c01 commit 305f108

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/backend/executor/nodeBitmapHeapscan.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ BitmapHeapNext(BitmapHeapScanState *node)
211211
break;
212212
}
213213

214+
BitmapAdjustPrefetchIterator(node, tbmres);
215+
214216
/*
215217
* We can skip fetching the heap page if we don't need any fields
216218
* from the heap, and the bitmap entries don't need rechecking,
@@ -366,7 +368,10 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
366368
{
367369
#ifdef USE_PREFETCH
368370
TBMIterator *prefetch_iterator = node->prefetch_iterator;
369-
Assert(node->pstate == NULL);
371+
372+
/* NEON: we are not using prefetch iterator for parallel plan so no need to adjust it */
373+
if (node->pstate != NULL)
374+
return;
370375

371376
if (node->prefetch_pages > 0)
372377
{
@@ -396,6 +401,10 @@ static inline void
396401
BitmapAdjustPrefetchTarget(BitmapHeapScanState *node)
397402
{
398403
#ifdef USE_PREFETCH
404+
/* NEON: we are not using prefetch iterator for parallel plan so no need to adjust it */
405+
if (node->pstate != NULL)
406+
return;
407+
399408
if (node->prefetch_target >= node->prefetch_maximum)
400409
/* don't increase any further */ ;
401410
else if (node->prefetch_target >= node->prefetch_maximum / 2)

0 commit comments

Comments
 (0)