diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-02-03 11:19:58 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-02-03 11:19:58 +0900 |
commit | b998fedab74c6cf4e564c17f4171881759a093ee (patch) | |
tree | 5a7dd5210ff68caf8d98e17bacf91b719f1d272d /src | |
parent | fcce828529ee36ac452aead60fe95648bde3256c (diff) | |
download | postgresql-b998fedab74c6cf4e564c17f4171881759a093ee.tar.gz postgresql-b998fedab74c6cf4e564c17f4171881759a093ee.zip |
Improve comment on top of pgstat_count_io_op_time()
This commit adds more documentation to pgstat_count_io_op_time() in
pgstat_io.c, explaining its internals for pgstat_count_buffer_*(),
pgBufferUsage and the contexts where these are used.
Extracted from a larger patch by the same author.
Author: Nazir Bilal Yavuz
Discussion: https://postgr.es/m/CAN55FZ3AiQ+ZMxUuXnBpd0Rrh1YhwJ5FudkHg=JU0P+-W8T4Vg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/activity/pgstat_io.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/utils/activity/pgstat_io.c b/src/backend/utils/activity/pgstat_io.c index 6ff5d9e96a1..7aee6a396f2 100644 --- a/src/backend/utils/activity/pgstat_io.c +++ b/src/backend/utils/activity/pgstat_io.c @@ -107,6 +107,14 @@ pgstat_prepare_io_time(bool track_io_guc) /* * Like pgstat_count_io_op() except it also accumulates time. + * + * The calls related to pgstat_count_buffer_*() are for pgstat_database. As + * pg_stat_database only counts block read and write times, these are done for + * IOOP_READ, IOOP_WRITE and IOOP_EXTEND. + * + * pgBufferUsage is used for EXPLAIN. pgBufferUsage has write and read stats + * for shared, local and temporary blocks. pg_stat_io does not track the + * activity of temporary blocks, so these are ignored here. */ void pgstat_count_io_op_time(IOObject io_object, IOContext io_context, IOOp io_op, |