pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add infrastructure to track WAL usage.
Date: Sat, 04 Apr 2020 04:39:55 +0000
Message-ID: <E1jKab5-0008L7-SV@gemulon.postgresql.org> (raw)

Add infrastructure to track WAL usage.

This allows gathering the WAL generation statistics for each statement
execution.  The three statistics that we collect are the number of WAL
records, the number of full page writes and the amount of WAL bytes
generated.

This helps the users who have write-intensive workload to see the impact
of I/O due to WAL.  This further enables us to see approximately what
percentage of overall WAL is due to full page writes.

In the future, we can extend this functionality to allow us to compute the
the exact amount of WAL data due to full page writes.

This patch in itself is just an infrastructure to compute WAL usage data.
The upcoming patches will expose this data via explain, auto_explain,
pg_stat_statements and verbose (auto)vacuum output.

Author: Kirill Bychik, Julien Rouhaud
Reviewed-by: Dilip Kumar, Fujii Masao and Amit Kapila
Discussion: https://postgr.es/m/CAB-hujrP8ZfUkvL5OYETipQwA=e3n7oqHFU=4ZLxWS_Cza3kQQ@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c    | 37 +++++++++++++++++------
src/backend/access/nbtree/nbtsort.c     | 40 +++++++++++++++++++++++++
src/backend/access/transam/xlog.c       | 12 +++++++-
src/backend/access/transam/xloginsert.c | 13 +++++---
src/backend/executor/execParallel.c     | 36 ++++++++++++++++------
src/backend/executor/instrument.c       | 53 +++++++++++++++++++++++++++++----
src/include/access/xlog.h               |  3 +-
src/include/executor/execParallel.h     |  1 +
src/include/executor/instrument.h       | 18 +++++++++--
src/tools/pgindent/typedefs.list        |  1 +
10 files changed, 182 insertions(+), 32 deletions(-)



Message-ID: <E1jKab5-0008L7-SV@gemulon.postgresql.org>
Permalink:  ../E1jKab5-0008L7-SV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jKab5-0008L7-SV@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: akapila@postgresql.org
  Subject: Re: pgsql: Add infrastructure to track WAL usage.
  In-Reply-To: <E1jKab5-0008L7-SV@gemulon.postgresql.org>
  References: <E1jKab5-0008L7-SV@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