pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal()
Date: Tue, 28 Oct 2025 07:22:07 +0000
Message-ID: <E1vDe1v-003sov-04@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f9a09aa2952039a9956b44d929b9df74d62a4cd4

Modified Files
--------------
doc/src/sgml/monitoring.sgml                |  9 +++++++++
src/backend/access/transam/xloginsert.c     |  6 ++++++
src/backend/catalog/system_views.sql        |  1 +
src/backend/executor/instrument.c           |  2 ++
src/backend/utils/activity/pgstat_backend.c |  1 +
src/backend/utils/activity/pgstat_wal.c     |  1 +
src/backend/utils/adt/pgstatfuncs.c         | 20 ++++++++++++++------
src/include/catalog/catversion.h            |  2 +-
src/include/catalog/pg_proc.dat             | 12 ++++++------
src/include/executor/instrument.h           |  1 +
src/include/pgstat.h                        |  3 ++-
src/test/regress/expected/rules.out         |  3 ++-
12 files changed, 46 insertions(+), 15 deletions(-)



Message-ID: <E1vDe1v-003sov-04@gemulon.postgresql.org>
Permalink:  ../E1vDe1v-003sov-04@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vDe1v-003sov-04@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal()
  In-Reply-To: <E1vDe1v-003sov-04@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox