Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring
Kirill Reshke <reshkekirill@gmail.com>
From: Kirill Reshke <reshkekirill@gmail.com>
To: Naga Appani <nagnrik@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-03-11T09:48:01Z
Lists: pgsql-hackers
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
On Tue, 11 Mar 2025 at 14:37, Naga Appani <nagnrik@gmail.com> wrote: > > > > On Mon, Mar 10, 2025 at 10:43 AM Naga Appani <nagnrik@gmail.com> wrote: >> >> Hi, >> Hi > ================= > Proposal > ================= > The internal ReadMultiXactCounts() function, implemented in multixact.c, directly calculates the number of MultiXact members by reading live state from shared memory. This approach avoids the performance issues of the current filesystem-based estimation methods. This proposal looks sane. It is indeed helpful to keep an eye out for multixact usage in systems that are heavily loaded. > By exposing ReadMultiXactCounts() for external use, we can provide PostgreSQL users with an efficient way to monitor MultiXact member usage. This could be particularly useful for integrating with tools like Amazon RDS Performance Insights and Amazon CloudWatch to provide enhanced database insights and proactive managed monitoring for users. > > Please let me know if this approach is acceptable, so I’ll go ahead and submit a patch. Let's give it a try! -- Best regards, Kirill Reshke