Add pg_stat_io view, providing more detailed IO statistics
authorAndres Freund <[email protected]>
Sat, 11 Feb 2023 17:51:58 +0000 (09:51 -0800)
committerAndres Freund <[email protected]>
Sat, 11 Feb 2023 17:52:15 +0000 (09:52 -0800)
commita9c70b46dbe152e094f137f7e6ba9cd3a638ee25
tree80a6b0827738a84b85878b34f001b00a7753ad0d
parent44e56baa80ff5fba150897308c8f25aa2251b16c
Add pg_stat_io view, providing more detailed IO statistics

Builds on 28e626bde00 and f30d62c2fc6. See the former for motivation.

Rows of the view show IO operations for a particular backend type, IO target
object, IO context combination (e.g. a client backend's operations on
permanent relations in shared buffers) and each column in the view is the
total number of IO Operations done (e.g. writes). So a cell in the view would
be, for example, the number of blocks of relation data written from shared
buffers by client backends since the last stats reset.

In anticipation of tracking WAL IO and non-block-oriented IO (such as
temporary file IO), the "op_bytes" column specifies the unit of the "reads",
"writes", and "extends" columns for a given row.

Rows for combinations of IO operation, backend type, target object and context
that never occur, are ommitted entirely. For example, checkpointer will never
operate on temporary relations.

Similarly, if an IO operation never occurs for such a combination, the IO
operation's cell will be null, to distinguish from 0 observed IO
operations. For example, bgwriter should not perform reads.

Note that some of the cells in the view are redundant with fields in
pg_stat_bgwriter (e.g. buffers_backend). For now, these have been kept for
backwards compatibility.

Bumps catversion.

Author: Melanie Plageman <[email protected]>
Author: Samay Sharma <[email protected]>
Reviewed-by: Maciek Sakrejda <[email protected]>
Reviewed-by: Lukas Fittl <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Reviewed-by: Justin Pryzby <[email protected]>
Discussion: https://postgr.es/m/20200124195226[email protected]
doc/src/sgml/monitoring.sgml
src/backend/catalog/system_views.sql
src/backend/utils/adt/pgstatfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/test/regress/expected/rules.out
src/tools/pgindent/typedefs.list