Add pruning fast path for all-visible and all-frozen pages
Melanie Plageman <melanieplageman@gmail.com>
Author:
Melanie Plageman <melanieplageman@gmail.com>
Date: 2026-03-22T19:46:50Z
Releases:
19 (unreleased)
Add pruning fast path for all-visible and all-frozen pages Because of the SKIP_PAGES_THRESHOLD optimization or a stale prune XID, heap_page_prune_and_freeze() can be invoked for pages with no pruning or freezing work to do. To avoid this, if a page is already all-frozen or it is all-visible and no freezing will be attempted, exit early. We can't exit early if vacuum passed DISABLE_PAGE_SKIPPING, though. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Kirill Reshke <reshkekirill@gmail.com> Discussion: https://postgr.es/m/bqc4kh5midfn44gnjiqez3bjqv4zogydguvdn446riw45jcf3y%404ez66il7ebvk
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/pruneheap.c | modified | +86 −1 |
| src/backend/access/heap/vacuumlazy.c | modified | +10 −0 |
| src/include/access/heapam.h | modified | +1 −0 |
Discussion
- eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) 168 messages · 2025-06-23 → 2026-04-21