pgsql: Add a new 'F' entry type for fixed-numbered stats in pgstats fil

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add a new 'F' entry type for fixed-numbered stats in pgstats fil
Date: 2024-07-11 07:24:54
Message-ID: E1sRoAg-001DMp-Nv@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a new 'F' entry type for fixed-numbered stats in pgstats file

This new entry type is used for all the fixed-numbered statistics,
making possible support for custom pluggable stats. In short, we need
to be able to detect more easily if a stats kind exists or not when
reading back its data from the pgstats file without a dependency on the
order of the entries read. The kind ID of the stats is added to the
data written.

The data is written in the same fashion as previously, with the
fixed-numbered stats first and the dshash entries next. The read part
becomes more flexible, loading fixed-numbered stats into shared memory
based on the new entry type found.

Bump PGSTAT_FILE_FORMAT_ID.

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Zot5bxoPYdS7yaoy@paquier.xyz

Branch
------
master

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

Modified Files
--------------
src/backend/utils/activity/pgstat.c | 51 ++++++++++++++++++++++++-------------
src/include/pgstat.h | 2 +-
2 files changed, 34 insertions(+), 19 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amul Sul 2024-07-11 11:11:54 Re: pgsql: Avoid crashing when a JIT-inlined backend function throws an err
Previous Message Michael Paquier 2024-07-11 00:24:20 pgsql: Add PgStat_KindInfo.init_shmem_cb