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

From Michael Paquier
Subject pgsql: Add a new 'F' entry type for fixed-numbered stats in pgstats fil
Date
Msg-id E1sRoAg-001DMp-Nv@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Add PgStat_KindInfo.init_shmem_cb
Next
From: Amul Sul
Date:
Subject: Re: pgsql: Avoid crashing when a JIT-inlined backend function throws an err