Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b998fed

Browse files
committed
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
1 parent fcce828 commit b998fed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/utils/activity/pgstat_io.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ pgstat_prepare_io_time(bool track_io_guc)
107107

108108
/*
109109
* Like pgstat_count_io_op() except it also accumulates time.
110+
*
111+
* The calls related to pgstat_count_buffer_*() are for pgstat_database. As
112+
* pg_stat_database only counts block read and write times, these are done for
113+
* IOOP_READ, IOOP_WRITE and IOOP_EXTEND.
114+
*
115+
* pgBufferUsage is used for EXPLAIN. pgBufferUsage has write and read stats
116+
* for shared, local and temporary blocks. pg_stat_io does not track the
117+
* activity of temporary blocks, so these are ignored here.
110118
*/
111119
void
112120
pgstat_count_io_op_time(IOObject io_object, IOContext io_context, IOOp io_op,

0 commit comments

Comments
 (0)