pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Track I/O timing for temporary file blocks in EXPLAIN (BUFFERS)
Date: Fri, 08 Apr 2022 02:33:37 +0000
Message-ID: <E1nceRM-000pI8-Q3@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/efb0ef909f605817da6b77c1f3fef0a24457ec16

Modified Files
--------------
doc/src/sgml/ref/explain.sgml         |  13 ++--
src/backend/commands/explain.c        |  42 ++++++++++---
src/backend/executor/instrument.c     |   6 ++
src/backend/storage/file/buffile.c    |  29 ++++++++-
src/include/executor/instrument.h     |   6 +-
src/test/regress/expected/explain.out | 112 +++++++++++++++++++---------------
src/test/regress/sql/explain.sql      |   7 ++-
7 files changed, 147 insertions(+), 68 deletions(-)



Message-ID: <E1nceRM-000pI8-Q3@gemulon.postgresql.org>
Permalink:  ../E1nceRM-000pI8-Q3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nceRM-000pI8-Q3@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Track I/O timing for temporary file blocks in EXPLAIN (BUFFERS)
  In-Reply-To: <E1nceRM-000pI8-Q3@gemulon.postgresql.org>
  References: <E1nceRM-000pI8-Q3@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox