Add explanations which are influenced by track_io_timing
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]https://www.postgresql.org/docs/devel/runtime-config-statistics.html#GUC-TRACK-IO-TIMING.
This is also described in the manual for pg_stat_statements
[2]: https://www.postgresql.org/docs/devel/pgstatstatements.html#PGSTATSTATEMENTS-COLUMNS
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
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
https://www.postgresql.org/docs/devel/pgstatstatements.html#PGSTATSTATEMENTS-COLUMNS
Regards,
--
Atsushi Torikoshi
Attachments:
add_explanation_for_track_io_timing.patchapplication/x-patch; name=add_explanation_for_track_io_timing.patchDownload
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
On 2020/05/13 21:54, Atsushi Torikoshi wrote:
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
+ in milliseconds(if <xref linkend="guc-track-io-timing"/> is enabled,
+ otherwise zero)
It's better to add a space character just after "seconds".
- written.
+ written. In addition, If <xref linkend="guc-track-io-timing"/> is enabled,
+ also include I/O Timings.
Isn't it better to just use clearer description like "the time reading and
writing data blocks" here instead of "I/O Timing"?
What about the attached patch based on yours?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:
add_explanation_for_track_io_timing_v2.patchtext/plain; charset=UTF-8; name=add_explanation_for_track_io_timing_v2.patch; x-mac-creator=0; x-mac-type=0Download
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 579ccd34d4..791f371d9d 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..292c655b6b 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -171,8 +171,9 @@ ROLLBACK;
<para>
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.
+ hit, read, dirtied, and written, the number of temp blocks read and
+ written, and the time spent reading and writing data file blocks
+ (in milliseconds) if <xref linkend="guc-track-io-timing"/> is enabled.
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;
Thanks for reviewing!
On Wed, May 13, 2020 at 11:27 PM Fujii Masao <masao.fujii@oss.nttdata.com>
wrote:
What about the attached patch based on yours?
It looks better.
Regards,
--
Atsushi Torikoshi
On 2020/05/15 9:50, Atsushi Torikoshi wrote:
Thanks for reviewing!
On Wed, May 13, 2020 at 11:27 PM Fujii Masao <masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>> wrote:
What about the attached patch based on yours?
It looks better.
Pushed. Thanks!
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
On Fri, May 22, 2020 at 11:37 PM Fujii Masao <masao.fujii@oss.nttdata.com>
wrote:
On 2020/05/15 9:50, Atsushi Torikoshi wrote:
Thanks for reviewing!
On Wed, May 13, 2020 at 11:27 PM Fujii Masao <
masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>> wrote:
What about the attached patch based on yours?
It looks better.
Pushed. Thanks!
Thanks for reviewing and improvements!
Regards,
--
Atsushi Torikoshi