summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-12-15 09:40:56 +0900
committerMichael Paquier <michael@paquier.xyz>2025-12-15 09:40:56 +0900
commit4ba012a8ed9c4214bd35b221c087f02efb1ac424 (patch)
tree27fb4adecec7c58d55b80d5c3aca25a5a71edcd0 /src/tools
parent58dad7f349b3fdbadda6bead21d596a448db1950 (diff)
Allow cumulative statistics to read/write auxiliary data from/to disk
Cumulative stats kinds gain the capability to write additional per-entry data when flushing the stats at shutdown, and read this data when loading back the stats at startup. This can be fit for example in the case of variable-length data (like normalized query strings), so as it becomes possible to link the shared memory stats entries to data that is stored in a different area, like a DSA segment. Three new optional callbacks are added to PgStat_KindInfo, available to variable-numbered stats kinds: * to_serialized_data: writes auxiliary data for an entry. * from_serialized_data: reads auxiliary data for an entry. * finish: performs actions after read/write/discard operations. This is invoked after processing all the entries of a kind, allowing extensions to close file handles and clean up resources. Stats kinds have the option to store this data in the existing pgstats file, but can as well store it in one or more additional files whose names can be built upon the entry keys. The new serialized callbacks are called once an entry key is read or written from the main stats file. A file descriptor to the main pgstats file is available in the arguments of the callbacks. Author: Sami Imseih <samimseih@gmail.com> Co-authored-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CAA5RZ0s9SDOu+Z6veoJCHWk+kDeTktAtC-KY9fQ9Z6BJdDUirQ@mail.gmail.com
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/pgindent/typedefs.list1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index d7459af2ba3..3451538565e 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -2279,6 +2279,7 @@ PgStat_StatFuncEntry
PgStat_StatReplSlotEntry
PgStat_StatSubEntry
PgStat_StatTabEntry
+PgStat_StatsFileOp
PgStat_SubXactStatus
PgStat_TableCounts
PgStat_TableStatus