Re: RFC: Allow EXPLAIN to Output Page Fault Information - Mailing list pgsql-hackers

From Atsushi Torikoshi
Subject Re: RFC: Allow EXPLAIN to Output Page Fault Information
Date
Msg-id CAM6-o=DnHSj2q9_+Wohrvagd-QAqvpoepNRS9LRadMBCkTAMkw@mail.gmail.com
Whole thread
In response to Re: RFC: Allow EXPLAIN to Output Page Fault Information  (vellaipandiyan sm <vellaipandiyan.sm@gmail.com>)
Responses Re: RFC: Allow EXPLAIN to Output Page Fault Information
Re: RFC: Allow EXPLAIN to Output Page Fault Information
List pgsql-hackers
Thanks for the review!

On Thu, May 21, 2026 at 2:38 PM vellaipandiyan sm
<vellaipandiyan.sm@gmail.com> wrote:
>
> Hello hackers,
>
> I reviewed the EXPLAIN storage I/O patch and the overall direction seems useful, especially for distinguishing
shared-bufferhits from actual storage reads during query analysis. 
>
> One concern that stood out to me from the later discussion is the interaction with asynchronous I/O and worker-based
I/Oaccounting. 
>
> Since the patch currently relies on per-process getrusage() statistics, it seems possible that the reported values
couldbecome partial or misleading once I/O is performed outside the backend process context. In particular,
worker-basedAIO could undercount storage reads/writes while still returning non-zero values, which may make the output
appearmore accurate than it actually is. 

Yeah, to avoid reporting the misleadingly underestimated values, no
output is shown when worker-based AIO is used, as described in the
docs:

+ ..Also, when
+ <xref linkend="guc-io-method"/> is set to <literal>worker</literal>, no output
+ will be shown, as I/O handled by asynchronous workers cannot be measured
+ accurately.

> I also wonder whether this should affect the semantics/documentation of the feature itself — i.e. whether the
reportednumbers should be described more explicitly as “backend-observed synchronous storage I/O” rather than total
queryI/O. 

Updated the patch to clarify that the reported values include not only
the backend process executing the query, but also any parallel query
worker processes involved in the query.

--
Regards,

Atsushi Torikoshi

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rename Postgres 19 to Postgres 26 (year-based)?
Next
From: Japin Li
Date:
Subject: Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement