Thread: pgsql: Improve IO accounting for temp relation writes

pgsql: Improve IO accounting for temp relation writes

From
Andres Freund
Date:
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/704261ecc694db11d9b5feb4f05f57778214ba2f

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c   | 17 +++++++++++++++++
src/backend/storage/buffer/localbuf.c | 16 ++++++++++++++++
2 files changed, 33 insertions(+)