Skip to content

Commit c52ccd7

Browse files
author
Konstantin Knizhnik
committed
Change prefetch logic for autovacuum
1 parent 4dfe66e commit c52ccd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,8 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
12451245
if (next_prefetch_block + prefetch_budget > blkno + vacrel->io_concurrency)
12461246
prefetch_budget = blkno + vacrel->io_concurrency - next_prefetch_block;
12471247

1248-
/* If next SKIP_PAGES_THRESHOLD are skippable then do not perform prefetch because vacuum will skip this blocks */
1249-
if (next_prefetch_block + SKIP_PAGES_THRESHOLD <= next_unskippable_block)
1248+
/* Do not perform prefetch if we are skipping current range */
1249+
if (skipping_current_range)
12501250
prefetch_budget = 0;
12511251

12521252
for (; prefetch_budget-- > 0; next_prefetch_block++)

0 commit comments

Comments
 (0)