Re: All-visible pages with valid prune xid are confusing - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: All-visible pages with valid prune xid are confusing
Date
Msg-id CAAKRu_ZT=yN6etTnX=dcCfKGXXXZP4YB1M30QVYcOm71r3Ds6Q@mail.gmail.com
Whole thread Raw
In response to Re: All-visible pages with valid prune xid are confusing  (Andres Freund <andres@anarazel.de>)
Responses Re: All-visible pages with valid prune xid are confusing
List pgsql-hackers
On Tue, Dec 2, 2025 at 1:41 PM Andres Freund <andres@anarazel.de> wrote:
>
> On December 2, 2025 1:23:57 PM EST, Melanie Plageman <melanieplageman@gmail.com> wrote:
>
> >What about on-access pruning during SELECT queries on a hot standby?
>
> There's no on-access-pruning on the hot standby itself, it'd lead to divergence between primary and standby (and you
couldn'tWAL log it). 

Ah, right.

> Therefore it doesn't seem important what we set the prune XID to. Any
> valid XID that's not in the future should do the trick. So how about
> adding a boolean flag to the WAL record, to indicate whether there's
> anything prunable left on the page or not?

We could add a flag to xl_heap_prune flags (which is now a uint16 and
thus has room) to indicate that there are prunable tuples.

In terms of finding some XID to set it to, could we do what updates
and deletes do and use the XLogRecord->xl_xid?

- Melanie



pgsql-hackers by date:

Previous
From: "Matheus Alcantara"
Date:
Subject: Re: Minor LLVM cleanups
Next
From: Heikki Linnakangas
Date:
Subject: Re: Bug in amcheck?