Simplify visibility check in heap_page_would_be_all_visible()
Melanie Plageman <melanieplageman@gmail.com>
Author:
Melanie Plageman <melanieplageman@gmail.com>
Date: 2026-02-26T20:41:45Z
Releases:
19 (unreleased)
Simplify visibility check in heap_page_would_be_all_visible() heap_page_would_be_all_visible() does not need to distinguish between HEAPTUPLE_RECENTLY_DEAD and HEAPTUPLE_DEAD tuples: any tuple in a state other than HEAPTUPLE_LIVE means the page is not all-visible and heap_page_would_be_all_visible() returns false. Given that, calling HeapTupleSatisfiesVacuum() is unnecessary, since it performs extra work to distinguish between dead and recently dead tuples using OldestXmin. Replace it with the more minimal HeapTupleSatisfiesVacuumHorizon(). Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Kirill Reshke <reshkekirill@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CALdSSPjvhGXihT_9f-GJabYU%3D_PjrFDUxYaURuTbfLyQM6TErg%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/vacuumlazy.c | modified | +2 −1 |
Discussion
- eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) 168 messages · 2025-06-23 → 2026-04-21