draft: feat(metrics): add PostgreSQL 19 multixact_size support using pg_get_multixact_stats()

Closes #84

Summary

Add native pg_get_multixact_stats() support for PostgreSQL 19+ to the multixact_size metric. This new SQL-level function is much faster than filesystem scanning (~0.1ms vs seconds).

Changes

  • Added new PostgreSQL 19 version of multixact_size metric SQL
  • Uses native pg_get_multixact_stats() when available
  • Falls back to existing Aurora/RDS/filesystem methods for cloud providers that may not have the native function yet
  • Calculates offsets_bytes from num_mxids (each SLRU segment is 256KB with 32768 8-byte entries)

pg_get_multixact_stats() returns

Column Type Description
num_mxids integer Total count of multixact IDs
num_members bigint Total number of member entries
members_size bigint Bytes occupied by members in pg_multixact/members/
oldest_multixact xid Oldest multixact ID still needed

Test plan

  • Verify YAML syntax is valid (done locally)
  • Test on PostgreSQL 19 dev build with native function
  • Verify fallback works on PG18 and earlier

References

Merge request reports

Loading