Track I/O timing for temporary file blocks in EXPLAIN (BUFFERS)
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/explain.sgml | modified | +7 −6 |
| src/backend/commands/explain.c | modified | +34 −8 |
| src/backend/executor/instrument.c | modified | +6 −0 |
| src/backend/storage/file/buffile.c | modified | +28 −1 |
| src/include/executor/instrument.h | modified | +4 −2 |
| src/test/regress/expected/explain.out | modified | +62 −50 |
| src/test/regress/sql/explain.sql | modified | +6 −1 |
Documentation touched
Discussion
- Showing I/O timings spent reading/writing temp buffers in EXPLAIN 25 messages · 2021-08-19 → 2022-04-08