Hi, When track_io_timing is on, I/O timing information is displayed in pg_stat_database, in the output of EXPLAIN when the BUFFERS option is used, and in pg_stat_statements as documented in [1].
This is also described in the manual for pg_stat_statements [2], however, manuals for pg_stat_database and EXPLAIN doesn't refer to it. I think it'll be better to add descriptions to both of them for consistency. Thoughts? [1] https://www.postgresql.org/docs/devel/runtime-config-statistics.html#GUC-TRACK-IO-TIMING [2] https://www.postgresql.org/docs/devel/pgstatstatements.html#PGSTATSTATEMENTS-COLUMNS Regards, -- Atsushi Torikoshi
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 579ccd34d4..186d1c10ca 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -2706,13 +2706,17 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i <entry><structfield>blk_read_time</structfield></entry> <entry><type>double precision</type></entry> <entry>Time spent reading data file blocks by backends in this database, - in milliseconds</entry> + in milliseconds(if <xref linkend="guc-track-io-timing"/> is enabled, + otherwise zero) + </entry> </row> <row> <entry><structfield>blk_write_time</structfield></entry> <entry><type>double precision</type></entry> <entry>Time spent writing data file blocks by backends in this database, - in milliseconds</entry> + in milliseconds(if <xref linkend="guc-track-io-timing"/> is enabled, + otherwise zero) + </entry> </row> <row> <entry><structfield>stats_reset</structfield></entry> diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index c6f333c3c9..c9fa7001c6 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -172,7 +172,8 @@ ROLLBACK; Include information on buffer usage. Specifically, include the number of shared blocks hit, read, dirtied, and written, the number of local blocks hit, read, dirtied, and written, and the number of temp blocks read and - written. + written. In addition, If <xref linkend="guc-track-io-timing"/> is enabled, + also include I/O Timings. A <emphasis>hit</emphasis> means that a read was avoided because the block was found already in cache when needed. Shared blocks contain data from regular tables and indexes; @@ -184,6 +185,8 @@ ROLLBACK; number of blocks <emphasis>written</emphasis> indicates the number of previously-dirtied blocks evicted from cache by this backend during query processing. + <emphasis>I/O Timings</emphasis> indicates the total time spent reading + and writing blocks in milliseconds. The number of blocks shown for an upper-level node includes those used by all its child nodes. In text format, only non-zero values are printed. This parameter may only be