Commit5cd72cc0c5made the VACUUM VERBOSE and autovacuum logs report buffer usage from the pgBufferUsage delta, which includes the parallel workers' usage, but left the I/O timings on the leader's pgStatBlockReadTime and pgStatBlockWriteTime. So the log counted the blocks the workers read and dirtied but not the time they spent on them. Fix this by taking the I/O timings from the same BufferUsage delta. This also removes a small error in the leader's own timings, since pgStatBlock{Read,Write}Time accumulate whole microseconds per I/O. Although5cd72cc0c5was backpatched to v15, BufferUsage on v16 doesn't track the I/O time of temporary relations, so the same fix there would drop that time from the log. We don't think a reporting issue is worth v16-specific code, nor worth leaving v16 unfixed between v15 and v17, so backpatch to v17 only. Found by Bharath using AI assisted review with Claude. Reported-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Sami Imseih <samimseih.pg@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Shihao Zhong <zhong950419@gmail.com> Discussion: https://postgr.es/m/CALj2ACXrqaHrYmGdpAoGKXtiY9Xw4o1dxSC+EELxn47GDO6HAQ@mail.gmail.com Backpatch-through: 17
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.