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: WAL log VM setting during vacuum phase I in XLOG_HEAP2_PRUNE_VAC
Date: Tue, 24 Mar 2026 20:53:00 +0000
Message-ID: <E1w58kF-001I93-12@gemulon.postgresql.org> (raw)

WAL log VM setting during vacuum phase I in XLOG_HEAP2_PRUNE_VACUUM_SCAN

Vacuum no longer emits a separate WAL record for each page set
all-visible or all-frozen during phase I. Instead, visibility map
updates are now included in the XLOG_HEAP2_PRUNE_VACUUM_SCAN record that
is already emitted for pruning and freezing.

Previously, heap_page_prune_and_freeze() determined whether a page was
all-visible, but the corresponding VM bits were only set later in
lazy_scan_prune(). Now the VM is updated immediately in
heap_page_prune_and_freeze(), at the same time as the heap
modifications. This reduces WAL volume produced by vacuum.

For now, vacuum is still the only user of heap_page_prune_and_freeze()
allowed to set the VM. On-access pruning is not yet able to set the VM.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Earlier version Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_ZMw6Npd_qm2KM%2BFwQ3cMOMx1Dh3VMhp8-V7SOLxdK9-g%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1252a4ee28636734d68f1acd33be45399c83dc53

Modified Files
--------------
src/backend/access/heap/pruneheap.c  | 245 +++++++++++++++++++++++++----------
src/backend/access/heap/vacuumlazy.c | 113 ++--------------
src/include/access/heapam.h          |  37 +++---
3 files changed, 205 insertions(+), 190 deletions(-)



Message-ID: <E1w58kF-001I93-12@gemulon.postgresql.org>
Permalink:  ../E1w58kF-001I93-12@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w58kF-001I93-12@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: WAL log VM setting during vacuum phase I in XLOG_HEAP2_PRUNE_VAC
  In-Reply-To: <E1w58kF-001I93-12@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