pgsql: Avoid useless calls in pg_get_multixact_stats()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid useless calls in pg_get_multixact_stats()
Date: 2026-07-01 03:17:41
Message-ID: E1welSI-000r9b-0H@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid useless calls in pg_get_multixact_stats()

MultiXactOffsetStorageSize() and GetMultiXactInfo() are called to gather
the information reported by the function, but were wasteful for the case
where a role does not have the privileges of pg_read_all_stats, where we
return a set of NULLs. These calls are moved to the code path where
their results are used.

Author: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAEudQAonQh7be=wOR-CJFW=bgMBz5wW_bv4t0OFxbgn-794JCQ@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9a2c07cbde9796049e4b37e3dde0b6f5253cb97b

Modified Files
--------------
src/backend/utils/adt/multixactfuncs.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Richard Guo 2026-07-01 06:13:21 pgsql: Improve UNION's output row count estimate
Previous Message John Naylor 2026-07-01 02:17:02 pgsql: Document wal_compression=on