Skip to content

Change prefetch logic for autovacuum #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025

Conversation

knizhnik
Copy link

No description provided.

@knizhnik knizhnik force-pushed the vacuum_prefetch_fix_v14 branch from 06cc193 to 06b405b Compare May 8, 2025 16:18
github-merge-queue bot pushed a commit to neondatabase/neon that referenced this pull request May 9, 2025
## Problem
See https://neondb.slack.com/archives/C03QLRH7PPD/p1745003314183649

Vacuum doesn't use prefetch because this strange logic in
`lazy_scan_heap`:

```
			/* And only up to the next unskippable block */
			if (next_prefetch_block + prefetch_budget > vacrel->next_unskippable_block)
				prefetch_budget = vacrel->next_unskippable_block - next_prefetch_block;
```
## Summary of changes

Disable prefetch only if vacuum jumps to next skippable block (there is
SKIP_PAGES_THRESHOLD) which cancel seqscan and perform jump only if gap
is large enough).


Postgres PRs:
neondatabase/postgres#620
neondatabase/postgres#621
neondatabase/postgres#622
neondatabase/postgres#623

---------

Co-authored-by: Konstantin Knizhnik <[email protected]>
@knizhnik knizhnik merged commit 06b405b into REL_14_STABLE_neon May 9, 2025
1 check passed
@knizhnik knizhnik deleted the vacuum_prefetch_fix_v14 branch May 9, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants