Files
postgresql/src/test/regress/sql
Michael Paquier 76def4cdd7 Add WAL data to backend statistics
This commit adds per-backend WAL statistics, providing the same
information as pg_stat_wal, except that it is now possible to know how
much WAL activity is happening in each backend rather than an overall
aggregate of all the activity.  Like pg_stat_wal, the implementation
relies on pgWalUsage, tracking the difference of activity between two
reports to pgstats.

This data can be retrieved with a new system function called
pg_stat_get_backend_wal(), that returns one tuple based on the PID
provided in input.  Like pg_stat_get_backend_io(), this is useful when
joined with pg_stat_activity to get a live picture of the WAL generated
for each running backend, showing how the activity is [un]balanced.

pgstat_flush_backend() gains a new flag value, able to control the flush
of the WAL stats.

This commit relies mostly on the infrastructure provided by
9aea73fc61d4, that has introduced backend statistics.

Bump catalog version.  A bump of PGSTAT_FILE_FORMAT_ID is not required,
as backend stats do not persist on disk.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/Z3zqc4o09dM/Ezyz@ip-10-97-1-34.eu-west-3.compute.internal
2025-03-11 09:04:11 +09:00
..
2024-01-31 15:02:28 +09:00
2025-01-24 14:56:22 -08:00
2025-03-04 20:07:30 +01:00
2025-02-10 10:03:37 -05:00
2025-02-17 12:44:12 +02:00
2025-03-04 20:07:30 +01:00
2025-02-17 12:44:12 +02:00
2024-07-19 11:52:32 -05:00
2022-08-25 10:31:20 +02:00
2024-10-07 10:56:16 -05:00
2024-07-02 10:43:12 +02:00
2025-02-21 11:19:59 +09:00
2025-02-07 09:46:59 +01:00
2025-02-07 09:46:59 +01:00
2024-02-28 15:17:23 +04:00
2025-03-11 09:04:11 +09:00
2024-04-18 21:28:07 +02:00
2024-04-16 16:21:31 +12:00