Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon - Mailing list pgsql-hackers

From Scott Ray
Subject Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon
Date
Msg-id dQhNr2KEwosovTvtTZYLEiW8XP-aTKRpBwtXyGO6hctiD9MPiV3e5RF3WiWndu-farqbW1NLJU-aL9lZ5qn1IKi-A9dKD-hjaY71xqC6UBs=@scottray.io
Whole thread
In response to Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon  (surya poondla <suryapoondla4@gmail.com>)
List pgsql-hackers
Hi Surya,

On Tuesday, September 29th, 2026 at 11:28 AM, surya poondla <suryapoondla4(at)gmail(dot)com> wrote:

> So both representations have been asked for, which makes me
> think the question may be which one is the base and which is built on
> top, not which one to have.

Any summary hides information DBAs need, and everyone will have a
different favorite interface, which Sami's proposal and Andres' 2020
and 2023 messages demonstrate.  For pg_stat_progress, Robert thought
it "much better to report slightly more detailed information and let
the user figure out what to do with it" and left any other interface
for later agreement [1].  This patch will take the same approach.

> When no
> row contributes to a horizon, the horizon advances to a baseline just
> past the newest completed xid, "which this view does not display".

pg_snapshot_xmax(pg_current_snapshot()) suffices.

> And
> the combined slot xmins "update only when a slot changes", so "a stale
> value that no row shows can briefly pin a horizon".  Those are the values
> a per-horizon summary row would need to report the horizon correctly.

Like the proc flags, the slot cache represents an implementation detail
that does not belong in any public interface.

[1] https://www.postgresql.org/message-id/CA+TgmoZqXUhTxvX6Z5M76_PFo63DJsKqCFxk-zC+KxpXKDBt=g@mail.gmail.com

--
Scott Ray
Attachment

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: issues with eager aggregation
Next
From: Michael Paquier
Date:
Subject: Re: injection_points: canceled or terminated waiters leak their wait slots