RE: [Proposal] Expose internal MultiXact member count function for efficient monitoring
Shinoda, Noriyoshi <noriyoshi.shinoda@hpe.com>
From: "Shinoda, Noriyoshi (PSD Japan FSI)" <noriyoshi.shinoda@hpe.com>
To: Michael Paquier <michael@paquier.xyz>, Naga Appani <nagnrik@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
Tomas Vondra <tomas@vondra.me>, Xuneng Zhou <xunengzhou@gmail.com>,
torikoshia <torikoshia@oss.nttdata.com>,
Kirill Reshke <reshkekirill@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-04-13T01:28:55Z
Lists: pgsql-hackers
Attachments
- pg_get_multixact_stats_doc_v1.diff (application/octet-stream) patch v1
Hi, thanks to the developers and reviewers.
It seems the data type of "num_mxids", which is the result of the "pg_get_multixact_stats" function, does not match the documentation.
In pg_proc.dat, the data type is int8.
[pg_proc.dat]
+ proname => 'pg_get_multixact_stats', provolatile => 'v',
+ proallargtypes => '{int8,int8,int8,xid}', proargmodes => '{o,o,o,o}',
However, the documentation specifies it as an "integer".
[func-info.sgml]
+ ( <parameter>num_mxids</parameter> <type>integer</type>,
+ <parameter>num_members</parameter> <type>bigint</type>,
There may be debate about whether uint32 should be called integer or bigint, but I think it's better if the implementation and documentation are consistent. The small attached patch changes the data type of the num_mxids column in the documentation to "bigint" to match the implementation.
Regards,
Noriyoshi Shinoda
-----Original Message-----
From: Michael Paquier <michael@paquier.xyz>
Sent: Tuesday, December 30, 2025 4:44 PM
To: Naga Appani <nagnrik@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; Tomas Vondra <tomas@vondra.me>; Xuneng Zhou <xunengzhou@gmail.com>; torikoshia <torikoshia@oss.nttdata.com>; Kirill Reshke <reshkekirill@gmail.com>; pgsql-hackers@postgresql.org
Subject: Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring
On Mon, Dec 29, 2025 at 08:57:11PM -0600, Naga Appani wrote:
> The oldest_multixact correctly advances to reflect the cleanup.
>
> Thanks for adding the pg_read_all_stats privilege check!
>
> I think this is ready for RFC.
Thanks for looking. I have done an extra round of brush-up, then applied the set. The buildfarm looks OK with it.
--
Michael
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_get_multixact_stats()
- 97b101776ce2 19 (unreleased) landed
-
Add MultiXactOffsetStorageSize() to multixact_internal.h
- 0e3ad4b96aed 19 (unreleased) landed
-
Change GetMultiXactInfo() to return the next multixact offset
- 9cf746a453c1 19 (unreleased) landed
-
Widen MultiXactOffset to 64 bits
- bd8d9c9bdfa0 19 (unreleased) cited
-
Refactor ReadMultiXactCounts() into GetMultiXactInfo()
- a977e419ee6e 19 (unreleased) landed
-
Move SQL-callable code related to multixacts into its own file
- df9133fa6384 19 (unreleased) landed
-
Split func.sgml into more manageable pieces
- 4e23c9ef65ac 19 (unreleased) cited