Re: All-visible pages with valid prune xid are confusing

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: All-visible pages with valid prune xid are confusing
Date: 2025-12-02 19:13:09
Message-ID: CAAKRu_ZT=yN6etTnX=dcCfKGXXXZP4YB1M30QVYcOm71r3Ds6Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 2, 2025 at 1:41 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On December 2, 2025 1:23:57 PM EST, Melanie Plageman <melanieplageman(at)gmail(dot)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't WAL 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-12-02 19:27:09 Re: Bug in amcheck?
Previous Message Matheus Alcantara 2025-12-02 18:53:55 Re: Minor LLVM cleanups