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: Keep newest live XID up-to-date even if page not all-visible
Date: Tue, 24 Mar 2026 19:39:17 +0000
Message-ID: <E1w57au-001HZX-1N@gemulon.postgresql.org> (raw)

Keep newest live XID up-to-date even if page not all-visible

During pruning, we keep track of the newest xmin of live tuples on the
page visible to all running and future transactions so that we can use
it later as the snapshot conflict horizon when setting the VM if the
page turns out to be all-visible.

Previously, we stopped updating this value once we determined the page
was not all-visible. However, maintaining it even when the page is not
all-visible is inexpensive and makes the snapshot conflict horizon
calculation clearer. This guarantees it won't contain a stale value.

Since we'll keep it up to date all the time now anyway, there's no
reason not to maintain set_all_visible for on-access pruning. This will
allow us to set the VM on-access in the future.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/bqc4kh5midfn44gnjiqez3bjqv4zogydguvdn446riw45jcf3y%404ez66il7ebvk

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9ba3ec076a68b82d49fb4d0ea008205befd2292b

Modified Files
--------------
src/backend/access/heap/pruneheap.c  | 138 +++++++++++++++--------------------
src/backend/access/heap/vacuumlazy.c |  30 ++++----
2 files changed, 73 insertions(+), 95 deletions(-)



Message-ID: <E1w57au-001HZX-1N@gemulon.postgresql.org>
Permalink:  ../E1w57au-001HZX-1N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w57au-001HZX-1N@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: Keep newest live XID up-to-date even if page not all-visible
  In-Reply-To: <E1w57au-001HZX-1N@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