diff options
author | Amit Kapila <akapila@postgresql.org> | 2020-05-05 08:00:53 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2020-05-05 08:00:53 +0530 |
commit | 69bfaf2e1de49de76d7dec1c45511932a5ef502b (patch) | |
tree | e9ff414948222324edbb33f0f603ee4800e218bd /contrib/pg_stat_statements | |
parent | 5545b69ae65f27ba1f4ceaf24486e98c186e9412 (diff) | |
download | postgresql-69bfaf2e1de49de76d7dec1c45511932a5ef502b.tar.gz postgresql-69bfaf2e1de49de76d7dec1c45511932a5ef502b.zip |
Change the display of WAL usage statistics in Explain.
In commit 33e05f89c5, we have added the option to display WAL usage
statistics in Explain and auto_explain. The display format used two spaces
between each field which is inconsistent with Buffer usage statistics which
is using one space between each field. Change the format to make WAL usage
statistics consistent with Buffer usage statistics.
This commit also changed the usage of "full page writes" to
"full page images" for WAL usage statistics to make it consistent with
other parts of code and docs.
Author: Julien Rouhaud, Amit Kapila
Reviewed-by: Justin Pryzby, Kyotaro Horiguchi and Amit Kapila
Discussion: https://postgr.es/m/CAB-hujrP8ZfUkvL5OYETipQwA=e3n7oqHFU=4ZLxWS_Cza3kQQ@mail.gmail.com
Diffstat (limited to 'contrib/pg_stat_statements')
-rw-r--r-- | contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql | 2 | ||||
-rw-r--r-- | contrib/pg_stat_statements/pg_stat_statements.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql b/contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql index d0a6c3b4fc8..0f63f08f7eb 100644 --- a/contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql +++ b/contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql @@ -43,7 +43,7 @@ CREATE FUNCTION pg_stat_statements(IN showtext boolean, OUT blk_read_time float8, OUT blk_write_time float8, OUT wal_records int8, - OUT wal_fpw int8, + OUT wal_fpi int8, OUT wal_bytes numeric ) RETURNS SETOF record diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 90bc6fd0135..4ce25fb88aa 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -189,7 +189,7 @@ typedef struct Counters double blk_write_time; /* time spent writing, in msec */ double usage; /* usage factor */ int64 wal_records; /* # of WAL records generated */ - int64 wal_fpw; /* # of WAL full page writes generated */ + int64 wal_fpi; /* # of WAL full page images generated */ uint64 wal_bytes; /* total amount of WAL bytes generated */ } Counters; @@ -1432,7 +1432,7 @@ pgss_store(const char *query, uint64 queryId, e->counters.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time); e->counters.usage += USAGE_EXEC(total_time); e->counters.wal_records += walusage->wal_records; - e->counters.wal_fpw += walusage->wal_fpw; + e->counters.wal_fpi += walusage->wal_fpi; e->counters.wal_bytes += walusage->wal_bytes; SpinLockRelease(&e->mutex); @@ -1824,7 +1824,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo, Datum wal_bytes; values[i++] = Int64GetDatumFast(tmp.wal_records); - values[i++] = Int64GetDatumFast(tmp.wal_fpw); + values[i++] = Int64GetDatumFast(tmp.wal_fpi); snprintf(buf, sizeof buf, UINT64_FORMAT, tmp.wal_bytes); |