Re: mxid_age() and age(xid) appear undocumented

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: mxid_age() and age(xid) appear undocumented
Date: 2023-11-14 01:00:43
Message-ID: CAH2-Wzkj1SAZkZw_ZFTvOjfFVy_nfianvvynRSOyke2J5mGovw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 13, 2023 at 4:43 PM Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> I looked into this and all the 4-byte xid functions are marked as
> deprecated for the 8-byte variants. I don't think documenting 4-byte
> mxid_age() and age(xid) makes sense anymore, and I don't see their value
> enough to create 8-byte versions, so I just added C comments that they
> were undocumented, in the attached patch.

I'm sympathetic to the goal of making 4 byte XIDs an on-disk
implementation detail that is all but completely hidden from users.
However, there are practical problems with taking that to its logical
extreme. At least right now.

These functions are in fact documented -- albeit only partially. There
are references to both in "Routine Vacuuming". Moreover, those
references are rather useful; they're the basis of many
monitoring/alerting queries. If anything, I'd recommend adding more
documentation for these two functions.

We also continue to show 32-bit XIDs (alongside 32-bit relfrozenxid)
in the output of VACUUM VERBOSE/autovacuum log messages. (Though that
issue can be fixed fairly easily.)

The bottom line is that there is only one way to figure out the age of
a table right now, and it involves 32-bit XIDs/MXIDs, and these two
functions. And, if we were to change something in this area, we'd
definitely need to provide for the needs of those monitoring queries I
mentioned.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2023-11-14 01:05:27 Re: mxid_age() and age(xid) appear undocumented
Previous Message Michael Paquier 2023-11-14 00:55:14 Re: Add new option 'all' to pg_stat_reset_shared()