diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c index 8cf0ede3797..9dcc07122d2 100644 --- a/src/backend/executor/nodeBitmapHeapscan.c +++ b/src/backend/executor/nodeBitmapHeapscan.c @@ -211,6 +211,8 @@ BitmapHeapNext(BitmapHeapScanState *node) break; } + BitmapAdjustPrefetchIterator(node, tbmres); + /* * We can skip fetching the heap page if we don't need any fields * from the heap, and the bitmap entries don't need rechecking, @@ -366,7 +368,10 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node, { #ifdef USE_PREFETCH TBMIterator *prefetch_iterator = node->prefetch_iterator; - Assert(node->pstate == NULL); + + /* NEON: we are not using prefetch iterator for parallel plan so no need to adjust it */ + if (node->pstate != NULL) + return; if (node->prefetch_pages > 0) { @@ -396,6 +401,10 @@ static inline void BitmapAdjustPrefetchTarget(BitmapHeapScanState *node) { #ifdef USE_PREFETCH + /* NEON: we are not using prefetch iterator for parallel plan so no need to adjust it */ + if (node->pstate != NULL) + return; + if (node->prefetch_target >= node->prefetch_maximum) /* don't increase any further */ ; else if (node->prefetch_target >= node->prefetch_maximum / 2)