From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report pages read from WAL buffers in pg_stat_io.hits
Date: Thu, 15 Oct 2026 23:09:28 +0000
Message-ID: <E1xHUZk-00000001nET-2AYP@gemulon.postgresql.org> (raw)
Report pages read from WAL buffers in pg_stat_io.hits
Callers of WALReadFromBuffers() read data from the WAL buffers
(currently only WAL senders). This commit makes now available the
number of pages read from the WAL uffers in pg_stat_io.hits under object
"wal" and context "normal".
A read from a WAL file is counted in pg_stat_io.reads and read_bytes.
This new information can be useful for the tuning of wal_buffers, where
the number of hits matches with the number of pages found as available
in the buffers.
Note that WALReadFromBuffers() may be called for an amount of data worth
less than one WAL page, and that a partial page read is counted as one
hit.
Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CALj2ACVfF2Uj9NoFy-5m98HNtjHpuD17EDE9twVeJng-jTAe7A@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/856a6594d86e4a7c0e9490253912af3f6159802f
Modified Files
--------------
doc/src/sgml/monitoring.sgml | 8 +++++++-
src/backend/access/transam/xlog.c | 6 ++++++
src/backend/utils/activity/pgstat_io.c | 9 ++++++---
src/test/recovery/t/001_stream_rep.pl | 9 +++++----
4 files changed, 24 insertions(+), 8 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Report pages read from WAL buffers in pg_stat_io.hits
In-Reply-To: <E1xHUZk-00000001nET-2AYP@gemulon.postgresql.org>
References: <E1xHUZk-00000001nET-2AYP@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