pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pruning fast path for all-visible and all-frozen pages
Date: Sun, 22 Mar 2026 19:48:09 +0000
Message-ID: <E1w4OmO-000yfB-1T@gemulon.postgresql.org> (raw)

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

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(-)



Message-ID: <E1w4OmO-000yfB-1T@gemulon.postgresql.org>
Permalink:  ../E1w4OmO-000yfB-1T@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w4OmO-000yfB-1T@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add pruning fast path for all-visible and all-frozen pages
  In-Reply-To: <E1w4OmO-000yfB-1T@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox