Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon

From: Scott Ray <scott(at)scottray(dot)io>
To: surya poondla <suryapoondla4(at)gmail(dot)com>
Cc: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon
Date: 2026-10-05 01:46:33
Message-ID: dQhNr2KEwosovTvtTZYLEiW8XP-aTKRpBwtXyGO6hctiD9MPiV3e5RF3WiWndu-farqbW1NLJU-aL9lZ5qn1IKi-A9dKD-hjaY71xqC6UBs=@scottray.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-10-05 02:14:36 Re: injection_points: canceled or terminated waiters leak their wait slots
Previous Message Richard Guo 2026-10-05 01:44:12 Re: issues with eager aggregation