Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal()
Michael Paquier <michael@paquier.xyz>
Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal() This new counter, called "wal_fpi_bytes", tracks the total amount in bytes of full page images (FPIs) generated in WAL. This data becomes available globally via pg_stat_wal, and for backend statistics via pg_stat_get_backend_wal(). Previously, this information could only be retrieved with pg_waldump or pg_walinspect, which may not be available depending on the environment, and are expensive to execute. It offers hints about how much FPIs impact the WAL generated, which could be a large percentage for some workloads, as well as the effects of wal_compression or page holes. Bump catalog version. Bump PGSTAT_FILE_FORMAT_ID, due to the addition of wal_fpi_bytes in PgStat_WalCounters. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAOzEurQtZEAfg6P0kU3Wa-f9BWQOi0RzJEMPN56wNTOmJLmfaQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +9 −0 |
| src/backend/access/transam/xloginsert.c | modified | +6 −0 |
| src/backend/catalog/system_views.sql | modified | +1 −0 |
| src/backend/executor/instrument.c | modified | +2 −0 |
| src/backend/utils/activity/pgstat_backend.c | modified | +1 −0 |
| src/backend/utils/activity/pgstat_wal.c | modified | +1 −0 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +14 −6 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +6 −6 |
| src/include/executor/instrument.h | modified | +1 −0 |
| src/include/pgstat.h | modified | +2 −1 |
| src/test/regress/expected/rules.out | modified | +2 −1 |
Discussion
- Add wal_fpi_bytes_[un]compressed to pg_stat_wal 9 messages · 2025-10-22 → 2025-11-03