Skip to content

Commit 92641d8

Browse files
committed
Change BitmapAdjustPrefetchIterator to accept BlockNumber
BitmapAdjustPrefetchIterator() only used the blockno member of the passed in TBMIterateResult to ensure that the prefetch iterator and regular iterator stay in sync. Pass it the BlockNumber only, so that we can move away from using the TBMIterateResult outside of table AM specific code. Author: Melanie Plageman Reviewed-by: Tomas Vondra, Andres Freund, Heikki Linnakangas Discussion: https://postgr.es/m/CAAKRu_ZwCwWFeL_H3ia26bP2e7HiKLWt0ZmGXPVwPO6uXq0vaA%40mail.gmail.com
1 parent 1fdb0ce commit 92641d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/executor/nodeBitmapHeapscan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
static TupleTableSlot *BitmapHeapNext(BitmapHeapScanState *node);
5353
static inline void BitmapDoneInitializingSharedState(ParallelBitmapHeapState *pstate);
5454
static inline void BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
55-
TBMIterateResult *tbmres);
55+
BlockNumber blockno);
5656
static inline void BitmapAdjustPrefetchTarget(BitmapHeapScanState *node);
5757
static inline void BitmapPrefetch(BitmapHeapScanState *node,
5858
TableScanDesc scan);
@@ -231,7 +231,7 @@ BitmapHeapNext(BitmapHeapScanState *node)
231231
break;
232232
}
233233

234-
BitmapAdjustPrefetchIterator(node, tbmres);
234+
BitmapAdjustPrefetchIterator(node, tbmres->blockno);
235235

236236
valid_block = table_scan_bitmap_next_block(scan, tbmres);
237237

@@ -342,7 +342,7 @@ BitmapDoneInitializingSharedState(ParallelBitmapHeapState *pstate)
342342
*/
343343
static inline void
344344
BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
345-
TBMIterateResult *tbmres)
345+
BlockNumber blockno)
346346
{
347347
#ifdef USE_PREFETCH
348348
ParallelBitmapHeapState *pstate = node->pstate;
@@ -361,7 +361,7 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
361361
/* Do not let the prefetch iterator get behind the main one */
362362
TBMIterateResult *tbmpre = tbm_iterate(prefetch_iterator);
363363

364-
if (tbmpre == NULL || tbmpre->blockno != tbmres->blockno)
364+
if (tbmpre == NULL || tbmpre->blockno != blockno)
365365
elog(ERROR, "prefetch and main iterators are out of sync");
366366
}
367367
return;

0 commit comments

Comments
 (0)