Add a new 'F' entry type for fixed-numbered stats in pgstats file
authorMichael Paquier <michael@paquier.xyz>
Thu, 11 Jul 2024 07:12:04 +0000 (16:12 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 11 Jul 2024 07:12:44 +0000 (16:12 +0900)
commit9e4664d950c125a1ff7bb29cd1593ca37f8b0c01
tree6ba41631ca21443a58e6704bbec52cc4b68d07b4
parent21471f18e9d9aa3383314ed8bc9163bc369109ae
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
src/backend/utils/activity/pgstat.c
src/include/pgstat.h