diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-04-08 11:27:21 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-04-08 11:27:21 +0900 |
commit | efb0ef909f605817da6b77c1f3fef0a24457ec16 (patch) | |
tree | cc85a34ce3c1918a439f69e3e6f0bab1191cd486 /src/include/executor | |
parent | dafae9707ab7e7079ce1ba22cebda4557d0cbaf3 (diff) | |
download | postgresql-efb0ef909f605817da6b77c1f3fef0a24457ec16.tar.gz postgresql-efb0ef909f605817da6b77c1f3fef0a24457ec16.zip |
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
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/instrument.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h index 1b7157bdd15..2945cce3a97 100644 --- a/src/include/executor/instrument.h +++ b/src/include/executor/instrument.h @@ -33,8 +33,10 @@ typedef struct BufferUsage int64 local_blks_written; /* # of local disk blocks written */ int64 temp_blks_read; /* # of temp blocks read */ int64 temp_blks_written; /* # of temp blocks written */ - instr_time blk_read_time; /* time spent reading */ - instr_time blk_write_time; /* time spent writing */ + instr_time blk_read_time; /* time spent reading blocks */ + instr_time blk_write_time; /* time spent writing blocks */ + instr_time temp_blk_read_time; /* time spent reading temp blocks */ + instr_time temp_blk_write_time; /* time spent writing temp blocks */ } BufferUsage; /* |