From 101e115b3885dd966a839ef50b450771988fa9aa Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 9 May 2025 09:54:40 +0300 Subject: [PATCH] Change prefetch logic in vacuum (#11650) ## 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: https://github.com/neondatabase/postgres/pull/620 https://github.com/neondatabase/postgres/pull/621 https://github.com/neondatabase/postgres/pull/622 https://github.com/neondatabase/postgres/pull/623 --------- Co-authored-by: Konstantin Knizhnik --- vendor/postgres-v14 | 2 +- vendor/postgres-v15 | 2 +- vendor/postgres-v17 | 2 +- vendor/revisions.json | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/postgres-v14 b/vendor/postgres-v14 index 108856a4ae..06b405bc98 160000 --- a/vendor/postgres-v14 +++ b/vendor/postgres-v14 @@ -1 +1 @@ -Subproject commit 108856a4ae76be285b04497a0ed08fcbe60ddbe9 +Subproject commit 06b405bc982fd53522689aa4acbfd9c44b7993cf diff --git a/vendor/postgres-v15 b/vendor/postgres-v15 index b838c8969b..72f83df76c 160000 --- a/vendor/postgres-v15 +++ b/vendor/postgres-v15 @@ -1 +1 @@ -Subproject commit b838c8969b7c63f3e637a769656f5f36793b797c +Subproject commit 72f83df76c61ce18d81bd371f0afd2a43d59c052 diff --git a/vendor/postgres-v17 b/vendor/postgres-v17 index b763ab54b9..0d59c91c1a 160000 --- a/vendor/postgres-v17 +++ b/vendor/postgres-v17 @@ -1 +1 @@ -Subproject commit b763ab54b98d232a0959371ab1d07f06ed77c49e +Subproject commit 0d59c91c1a23e667f1d1169d5f040b3fa0a0ab44 diff --git a/vendor/revisions.json b/vendor/revisions.json index 4307fd1c3f..10aad7e1a2 100644 --- a/vendor/revisions.json +++ b/vendor/revisions.json @@ -1,7 +1,7 @@ { "v17": [ "17.4", - "b763ab54b98d232a0959371ab1d07f06ed77c49e" + "0d59c91c1a23e667f1d1169d5f040b3fa0a0ab44" ], "v16": [ "16.8", @@ -9,10 +9,10 @@ ], "v15": [ "15.12", - "b838c8969b7c63f3e637a769656f5f36793b797c" + "72f83df76c61ce18d81bd371f0afd2a43d59c052" ], "v14": [ "14.17", - "108856a4ae76be285b04497a0ed08fcbe60ddbe9" + "06b405bc982fd53522689aa4acbfd9c44b7993cf" ] }