pgstat: Track more detailed relation IO statistics
authorAndres Freund <[email protected]>
Fri, 10 Feb 2023 06:22:26 +0000 (22:22 -0800)
committerAndres Freund <[email protected]>
Fri, 10 Feb 2023 06:22:26 +0000 (22:22 -0800)
commitf30d62c2fc60acfa62d3b83a73dc9bf7f83cfe2f
treec66e2b3bb3f0fb8c76c6e185fcba9e8e985fde83
parent40d0b2d4153d903d41adee6a303428540389191b
pgstat: Track more detailed relation IO statistics

Commit 28e626bde00 introduced the infrastructure for tracking more detailed IO
statistics. This commit adds the actual collection of the new IO statistics
for relations and temporary relations. See aforementioned commit for goals and
high-level design.

The changes in this commit are fairly straight-forward. The bulk of the change
is to passing sufficient information to the callsites of pgstat_count_io_op().

A somewhat unsightly detail is that it currently is hard to find a better
place to count fsyncs than in md.c, whereas the other pgstat_count_io_op()
calls are in bufmgr.c/localbuf.c. As the number of fsyncs is tied to md.c
implementation details, it's not obvious there is a better answer.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/20200124195226[email protected]
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/freelist.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/smgr/md.c
src/include/storage/buf_internals.h
src/include/storage/bufmgr.h