Commit 1fdb0ce
committed
BitmapHeapScan: Use correct recheck flag for skip_fetch
As of 7c70996, BitmapPrefetch() used the recheck flag for
the current block to determine whether or not it should skip prefetching
the proposed prefetch block. As explained in the comment, this assumed
the index AM will report the same recheck value for the future page as
it did for the current page - but there's no guarantee.
This only affects prefetching - if the recheck flag changes, we may
prefetch blocks unecessarily and not prefetch blocks that will be
needed. But we don't need to rely on that assumption - we know the
recheck flag for the block we're considering prefetching, so we can
use that.
The impact is very limited in practice - the opclass would need to
assign different recheck flags to different blocks, but none of the
built-in opclasses seems to do that.
Author: Melanie Plageman
Reviewed-by: Tomas Vondra, Andres Freund, Tom Lane
Discussion: https://postgr.es/m/1939305.1712415547%40sss.pgh.pa.us1 parent 04e72ed commit 1fdb0ce
1 file changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | 478 | | |
484 | 479 | | |
485 | | - | |
| 480 | + | |
486 | 481 | | |
487 | 482 | | |
488 | 483 | | |
| |||
533 | 528 | | |
534 | 529 | | |
535 | 530 | | |
536 | | - | |
| 531 | + | |
537 | 532 | | |
538 | 533 | | |
539 | 534 | | |
| |||
0 commit comments