diff options
author | Fujii Masao | 2020-10-02 01:17:11 +0000 |
---|---|---|
committer | Fujii Masao | 2020-10-02 01:17:11 +0000 |
commit | 8d9a935965f01b7759a8c23ff6291000b670a2bf (patch) | |
tree | 087be8ff79f83042fe0c84771c7987bb389a25bf /doc/src | |
parent | 9d0bd95fa90a7243047a74e29f265296a9fc556d (diff) |
Add pg_stat_wal statistics view.
This view shows the statistics about WAL activity. Currently it has only
two columns: wal_buffers_full and stats_reset. wal_buffers_full column
indicates the number of times WAL data was written to the disk because
WAL buffers got full. This information is useful when tuning wal_buffers.
stats_reset column indicates the time at which these statistics were
last reset.
pg_stat_wal view is also the basic infrastructure to expose other
various statistics about WAL activity later.
Bump PGSTAT_FILE_FORMAT_ID due to the change in pgstat format.
Bump catalog version.
Author: Masahiro Ikeda
Reviewed-by: Takayuki Tsunakawa, Kyotaro Horiguchi, Amit Kapila, Fujii Masao
Discussion: https://postgr.es/m/188bd3f2d2233cf97753b5ced02bb050@oss.nttdata.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 4e0193a967c..495018009a2 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -425,6 +425,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser </row> <row> + <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry> + <entry>One row only, showing statistics about WAL activity. See + <link linkend="monitoring-pg-stat-wal-view"> + <structname>pg_stat_wal</structname></link> for details. + </entry> + </row> + + <row> <entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry> <entry>One row per database, showing database-wide statistics. See <link linkend="monitoring-pg-stat-database-view"> @@ -3280,6 +3288,56 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </sect2> + <sect2 id="monitoring-pg-stat-wal-view"> + <title><structname>pg_stat_wal</structname></title> + + <indexterm> + <primary>pg_stat_wal</primary> + </indexterm> + + <para> + The <structname>pg_stat_wal</structname> view will always have a + single row, containing data about WAL activity of the cluster. + </para> + + <table id="pg-stat-wal-view" xreflabel="pg_stat_wal"> + <title><structname>pg_stat_wal</structname> View</title> + <tgroup cols="1"> + <thead> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + Column Type + </para> + <para> + Description + </para></entry> + </row> + </thead> + + <tbody> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>wal_buffers_full</structfield> <type>bigint</type> + </para> + <para> + Number of times WAL data was written to the disk because WAL buffers got full + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>stats_reset</structfield> <type>timestamp with time zone</type> + </para> + <para> + Time at which these statistics were last reset + </para></entry> + </row> + </tbody> + </tgroup> + </table> + +</sect2> + <sect2 id="monitoring-pg-stat-database-view"> <title><structname>pg_stat_database</structname></title> @@ -4668,8 +4726,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i argument. The argument can be <literal>bgwriter</literal> to reset all the counters shown in the <structname>pg_stat_bgwriter</structname> - view, or <literal>archiver</literal> to reset all the counters shown in - the <structname>pg_stat_archiver</structname> view. + view, <literal>archiver</literal> to reset all the counters shown in + the <structname>pg_stat_archiver</structname> view or <literal>wal</literal> + to reset all the counters shown in the <structname>pg_stat_wal</structname> view. </para> <para> This function is restricted to superusers by default, but other users |