pgsql: Add infrastructure to track WAL usage.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add infrastructure to track WAL usage.
Date: 2020-04-04 04:39:55
Message-ID: E1jKab5-0008L7-SV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2020-04-04 07:11:25 Re: pgsql: Improve handling of parameter differences in physical replicatio
Previous Message Jeff Davis 2020-04-04 03:11:44 pgsql: Include chunk overhead in hash table entry size estimate.