pgsql: Add pruning fast path for all-visible and all-frozen pages

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add pruning fast path for all-visible and all-frozen pages
Date: 2026-03-22 19:48:09
Message-ID: E1w4OmO-000yfB-1T@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Discussion: https://postgr.es/m/bqc4kh5midfn44gnjiqez3bjqv4zogydguvdn446riw45jcf3y%404ez66il7ebvk

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/01b7e4a46d0fa8478c1142f65ee441fb0c32cca1

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 87 +++++++++++++++++++++++++++++++++++-
src/backend/access/heap/vacuumlazy.c | 10 +++++
src/include/access/heapam.h | 1 +
3 files changed, 97 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2026-03-22 21:32:03 pgsql: Add fake LSN support to hash index AM.
Previous Message Peter Geoghegan 2026-03-22 17:20:51 pgsql: Make IndexScanInstrumentation a pointer in executor scan nodes.