Improve IO accounting for temp relation writes

Andres Freund <andres@anarazel.de>

Commit: 704261ecc694db11d9b5feb4f05f57778214ba2f
Author: Andres Freund <andres@anarazel.de>
Date: 2023-04-07T20:24:26Z
Releases: 16.0
Improve IO accounting for temp relation writes

Both pgstat_database and pgBufferUsage count IO timing for reads of temporary
relation blocks into local buffers. However, both failed to count write IO
timing for flushes of dirty local buffers. Fix.

Additionally, FlushRelationBuffers() seems to have omitted counting write
IO (both count and timing) stats for both pgstat_database and
pgBufferUsage. Fix.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20230321023451.7rzy4kjj2iktrg2r%40awork3.anarazel.de

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +17 −0
src/backend/storage/buffer/localbuf.c modified +16 −0

Discussion