On Tue, Jul 21, 2026 at 2:22 PM Andrey Rachitskiy <[email protected]> wrote:
>
> I tried implementing the approach Andres suggested, so that we keep
> recording the foreign-IO wait time rather than dropping it.
>
> The patch:
> - adds pgstat_count_io_time() for timing-only updates (no operation count).
> - switches WaitReadBuffers() to use pgstat_count_io_time().
> - keeps pgstat_count_io_op_time() for counted operations, with Assert(cnt > 
> 0).
> - stops requiring a non-zero count whenever time is non-zero.
> - briefly documents that per-backend IO stats may then show read_time
>   without matching reads.

I committed a version of this that just removes the requirement for
non-zero count when time is non-zero. I didn't think the function
added much value and, especially for the backpatch, it's better if we
don't have to add a new function. Thanks Andrey for the patch, Justin
for the report, and Andres for weighing in.

- Melanie


Reply via email to