Re: pg_get_multixact_members not documented

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_get_multixact_members not documented
Date: 2025-06-05 13:24:04
Message-ID: CAExHW5tK8KZiNyTfmWbWCg_VSr1Tpqa+rBRP7Jd_-ifu4DwdaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 5, 2025 at 2:11 AM Sami Imseih <samimseih(at)gmail(dot)com> wrote:

> v2 addresses the comments.
>
> Adds a new section called "Multixact Information Functions" and a reference
> to pg_get_multixact_members after the description of what multixact members
> are in maintenance.sgml.
>
> As I spent some time looking into this, I still think we should document
> this
> function because of its use in blogs and examples that describe multixact.
>

+1. PFA diff of some edits. Please incorporate them in your patch if you
find them correct.

The table description from Alvaro's patch is better. The change is included
in the diff.

We developers may understand the mode text "sh", "keysh" etc. But it may
not be user friendly. It would have been better if the function would
have reported standard modes as described in [1] but we can't change that
now. It might help if we add mapping in the documentation.

"" ... each member of the multixact identified by the given mxid' sounds
more accurate compared to " ... each member of a given multixact ID". That
document page seems to differentiate between a transaction and transaction
ID. I think we should try to do the same for multixact.

>
> However, this function does not appear to be very practical to use, because
> the only visible MXID to the user is the oldest one, via
> pg_database.datminmxid
> or pg_class.relfrozenxid, or with the help of the contrib extension
> pgrowlocks.
>

If somebody starts from a row itself e.g. select xmax, * from t1 ... , this
function gives the transactions that have locked a given row. So not that
useless.

> I really think this is an area that needs improvement. We tell users to
> ignore
> transactions that have "no chance" of appearing in a multixact, but what
> that
> really means is the user must somehow figure this out on their own. I don't
> think it would be unrealistic to expose real-time information about
> backends
> with transactions involved in multixacts.
>

+1. Multixacts are highly under documented in user facing as well as
internal documentations. Thanks for the patch.

[1]
https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES
--
Best Wishes,
Ashutosh Bapat

Attachment Content-Type Size
diff.patch.txt text/plain 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2025-06-05 13:35:19 Re: Retiring some encodings?
Previous Message Sami Imseih 2025-06-05 12:42:48 Re: Improve explicit cursor handling in pg_stat_statements