postgresql/src/backend/catalog
Michael Paquier 9aea73fc61 Add backend-level statistics to pgstats
This adds a new variable-numbered statistics kind in pgstats, where the
object ID key of the stats entries is based on the proc number of the
backends.  This acts as an upper-bound for the number of stats entries
that can exist at once.  The entries are created when a backend starts
after authentication succeeds, and are removed when the backend exits,
making the stats entry exist for as long as their backend is up and
running.  These are not written to the pgstats file at shutdown (note
that write_to_file is disabled, as a safety measure).

Currently, these stats include only information about the I/O generated
by a backend, using the same layer as pg_stat_io, except that it is now
possible to know how much activity is happening in each backend rather
than an overall aggregate of all the activity.  A function called
pg_stat_get_backend_io() is added to access this data depending on the
PID of a backend.  The existing structure could be expanded in the
future to add more information about other statistics related to
backends, depending on requirements or ideas.

Auxiliary processes are not included in this set of statistics.  These
are less interesting to have than normal backends as they have dedicated
entries in pg_stat_io, and stats kinds of their own.

This commit includes also pg_stat_reset_backend_stats(), function able
to reset all the stats associated to a single backend.

Bump catalog version and PGSTAT_FILE_FORMAT_ID.

Author: Bertrand Drouvot
Reviewed-by: Álvaro Herrera, Kyotaro Horiguchi, Michael Paquier, Nazir
Bilal Yavuz
Discussion: https://postgr.es/m/ZtXR+CtkEVVE/LHF@ip-10-97-1-34.eu-west-3.compute.internal
2024-12-19 13:19:22 +09:00
..
aclchk.c Proper object locking for GRANT/REVOKE 2024-11-15 11:03:48 +01:00
catalog.c For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:18 -07:00
Catalog.pm Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
dependency.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
genbki.pl Generate syscache info from catalog files 2024-01-23 07:31:06 +01:00
heap.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
index.c Update comments about index parallel builds 2024-12-17 15:40:07 +01:00
indexing.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
information_schema.sql Add pg_constraint rows for not-null constraints 2024-11-08 13:28:48 +01:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
namespace.c Fix search_path cache initialization. 2024-10-07 17:51:14 -07:00
objectaccess.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
objectaddress.c Make getObjectDescription robust against dangling amproc type links. 2024-12-07 14:28:16 -05:00
partition.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_aggregate.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_attrdef.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_cast.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_class.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_collation.c Introduce "builtin" collation provider. 2024-03-13 23:33:44 -07:00
pg_constraint.c Silence compilers about extractNotNullColumn() 2024-11-12 11:35:43 +01:00
pg_conversion.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_db_role_setting.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_depend.c Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
pg_enum.c Allow more cases to pass the unsafe-use-of-new-enum-value restriction. 2024-03-24 14:30:29 -04:00
pg_inherits.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_largeobject.c Deduplicate code in LargeObjectExists and myLargeObjectExists. 2024-09-12 21:45:42 +09:00
pg_namespace.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_operator.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_parameter_acl.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_proc.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
pg_publication.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
pg_range.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_shdepend.c Improve tracking of role dependencies of pg_init_privs entries. 2024-06-17 12:55:10 -04:00
pg_subscription.c Refactor code converting a publication name List to a StringInfo 2024-10-25 12:02:04 +09:00
pg_type.c Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
sql_feature_packages.txt Update SQL features 2023-05-02 10:59:21 +02:00
sql_features.txt JSON_TABLE: Add support for NESTED paths and columns 2024-04-08 16:14:13 +09:00
storage.c RelationTruncate() must set DELAY_CHKPT_START. 2024-12-03 10:12:05 +13:00
system_functions.sql Add backend-level statistics to pgstats 2024-12-19 13:19:22 +09:00
system_views.sql Add two attributes to pg_stat_database for parallel workers activity 2024-11-11 10:40:48 +09:00
toasting.c Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:18 -07:00