diff options
author | Amit Kapila <akapila@postgresql.org> | 2020-04-04 10:02:08 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2020-04-04 10:02:08 +0530 |
commit | df3b181499b40523bd6244a4e5eb554acb9020ce (patch) | |
tree | 520cb5eee0f4c1404face0b9df8be2c68158a7d2 /src/include/executor/execParallel.h | |
parent | 0588ee63aa2d8c5765d086991555cd9acdd4d86f (diff) | |
download | postgresql-df3b181499b40523bd6244a4e5eb554acb9020ce.tar.gz postgresql-df3b181499b40523bd6244a4e5eb554acb9020ce.zip |
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
Diffstat (limited to 'src/include/executor/execParallel.h')
-rw-r--r-- | src/include/executor/execParallel.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h index 17d07cf020c..5a39a5b29c4 100644 --- a/src/include/executor/execParallel.h +++ b/src/include/executor/execParallel.h @@ -26,6 +26,7 @@ typedef struct ParallelExecutorInfo PlanState *planstate; /* plan subtree we're running in parallel */ ParallelContext *pcxt; /* parallel context we're using */ BufferUsage *buffer_usage; /* points to bufusage area in DSM */ + WalUsage *wal_usage; /* walusage area in DSM */ SharedExecutorInstrumentation *instrumentation; /* optional */ struct SharedJitInstrumentation *jit_instrumentation; /* optional */ dsa_area *area; /* points to DSA area in DSM */ |