From efb0ef909f605817da6b77c1f3fef0a24457ec16 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Fri, 8 Apr 2022 11:27:21 +0900 Subject: Track I/O timing for temporary file blocks in EXPLAIN (BUFFERS) Previously, the output of EXPLAIN (BUFFERS) option showed only the I/O timing spent reading and writing shared and local buffers. This commit adds on top of that the I/O timing for temporary buffers in the output of EXPLAIN (for spilled external sorts, hashes, materialization. etc). This can be helpful for users in cases where the I/O related to temporary buffers is the bottleneck. Like its cousin, this information is available only when track_io_timing is enabled. Playing the patch, this is showing an extra overhead of up to 1% even when using gettimeofday() as implementation for interval timings, which is slightly within the usual range noise still that's measurable. Author: Masahiko Sawada Reviewed-by: Georgios Kokolatos, Melanie Plageman, Julien Rouhaud, Ranier Vilela Discussion: https://postgr.es/m/CAD21AoAJgotTeP83p6HiAGDhs_9Fw9pZ2J=_tYTsiO5Ob-V5GQ@mail.gmail.com --- doc/src/sgml/ref/explain.sgml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index 4d758fb237e..857c4e6e867 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -174,14 +174,15 @@ 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, the number of temp blocks read and - written, and the time spent reading and writing data file blocks - (in milliseconds) if is enabled. - A hit means that a read was avoided because the block was - found already in cache when needed. + written, and the time spent reading and writing data file blocks and + temporary file blocks (in milliseconds) if + is enabled. A + hit 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; local blocks contain data from temporary tables and indexes; - while temp blocks contain short-term working data used in sorts, hashes, - Materialize plan nodes, and similar cases. + while temporary blocks contain short-term working data used in sorts, + hashes, Materialize plan nodes, and similar cases. The number of blocks dirtied indicates the number of previously unmodified blocks that were changed by this query; while the number of blocks written indicates the number of -- cgit v1.2.3