You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This commit adds per-backend WAL statistics, providing the sameinformation as pg_stat_wal, except that it is now possible to know howmuch WAL activity is happening in each backend rather than an overallaggregate of all the activity. Like pg_stat_wal, the implementationrelies on pgWalUsage, tracking the difference of activity between tworeports to pgstats.This data can be retrieved with a new system function calledpg_stat_get_backend_wal(), that returns one tuple based on the PIDprovided in input. Like pg_stat_get_backend_io(), this is useful whenjoined with pg_stat_activity to get a live picture of the WAL generatedfor each running backend, showing how the activity is [un]balanced.pgstat_flush_backend() gains a new flag value, able to control the flushof the WAL stats.This commit relies mostly on the infrastructure provided by9aea73f, 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