v2-0001-Fix-ordering-stats-views.patch

application/octet-stream

Filename: v2-0001-Fix-ordering-stats-views.patch
Type: application/octet-stream
Part: 1
Message: Re: [DOCS] Stats views and functions not in order?

Patch

Format: format-patch
Series: patch v2-0001
Subject: Fix ordering - stats views
File+
doc/src/sgml/monitoring.sgml 1237 1237
From 0a807d0c8e26cb720f2cd24cb60d0238dc9ef5a8 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 6 Oct 2022 15:19:51 +1100
Subject: [PATCH v2] Fix ordering - stats views

Rearrange the stats view sections to be alphabetically ordered.
---
 doc/src/sgml/monitoring.sgml | 2474 +++++++++++++++++++++---------------------
 1 file changed, 1237 insertions(+), 1237 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 342b20e..c223ca2 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2317,22 +2317,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-replication-view">
-  <title><structname>pg_stat_replication</structname></title>
+ <sect2 id="monitoring-pg-stat-all-indexes-view">
+  <title><structname>pg_stat_all_indexes</structname></title>
 
   <indexterm>
-   <primary>pg_stat_replication</primary>
+   <primary>pg_stat_all_indexes</primary>
   </indexterm>
 
-   <para>
-   The <structname>pg_stat_replication</structname> view will contain one row
-   per WAL sender process, showing statistics about replication to that
-   sender's connected standby server.  Only directly connected standbys are
-   listed; no information is available about downstream standby servers.
+  <para>
+   The <structname>pg_stat_all_indexes</structname> view will contain
+   one row for each index in the current database,
+   showing statistics about accesses to that specific index. The
+   <structname>pg_stat_user_indexes</structname> and
+   <structname>pg_stat_sys_indexes</structname> views
+   contain the same information,
+   but filtered to only show user and system indexes respectively.
   </para>
 
-  <table id="pg-stat-replication-view" xreflabel="pg_stat_replication">
-   <title><structname>pg_stat_replication</structname> View</title>
+  <table id="pg-stat-all-indexes-view" xreflabel="pg_stat_all_indexes">
+   <title><structname>pg_stat_all_indexes</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -2348,454 +2351,355 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>pid</structfield> <type>integer</type>
+       <structfield>relid</structfield> <type>oid</type>
       </para>
       <para>
-       Process ID of a WAL sender process
+       OID of the table for this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>usesysid</structfield> <type>oid</type>
+       <structfield>indexrelid</structfield> <type>oid</type>
       </para>
       <para>
-       OID of the user logged into this WAL sender process
+       OID of this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>usename</structfield> <type>name</type>
+       <structfield>schemaname</structfield> <type>name</type>
       </para>
       <para>
-       Name of the user logged into this WAL sender process
+       Name of the schema this index is in
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>application_name</structfield> <type>text</type>
+       <structfield>relname</structfield> <type>name</type>
       </para>
       <para>
-       Name of the application that is connected
-       to this WAL sender
+       Name of the table for this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>client_addr</structfield> <type>inet</type>
+       <structfield>indexrelname</structfield> <type>name</type>
       </para>
       <para>
-       IP address of the client connected to this WAL sender.
-       If this field is null, it indicates that the client is
-       connected via a Unix socket on the server machine.
+       Name of this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>client_hostname</structfield> <type>text</type>
+       <structfield>idx_scan</structfield> <type>bigint</type>
       </para>
       <para>
-       Host name of the connected client, as reported by a
-       reverse DNS lookup of <structfield>client_addr</structfield>. This field will
-       only be non-null for IP connections, and only when <xref linkend="guc-log-hostname"/> is enabled.
+       Number of index scans initiated on this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>client_port</structfield> <type>integer</type>
+       <structfield>idx_tup_read</structfield> <type>bigint</type>
       </para>
       <para>
-       TCP port number that the client is using for communication
-       with this WAL sender, or <literal>-1</literal> if a Unix socket is used
+       Number of index entries returned by scans on this index
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>backend_start</structfield> <type>timestamp with time zone</type>
+       <structfield>idx_tup_fetch</structfield> <type>bigint</type>
       </para>
       <para>
-       Time when this process was started, i.e., when the
-       client connected to this WAL sender
+       Number of live table rows fetched by simple index scans using this
+       index
       </para></entry>
      </row>
+    </tbody>
+   </tgroup>
+  </table>
+
+  <para>
+   Indexes can be used by simple index scans, <quote>bitmap</quote> index scans,
+   and the optimizer.  In a bitmap scan
+   the output of several indexes can be combined via AND or OR rules,
+   so it is difficult to associate individual heap row fetches
+   with specific indexes when a bitmap scan is used.  Therefore, a bitmap
+   scan increments the
+   <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_read</structfield>
+   count(s) for the index(es) it uses, and it increments the
+   <structname>pg_stat_all_tables</structname>.<structfield>idx_tup_fetch</structfield>
+   count for the table, but it does not affect
+   <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_fetch</structfield>.
+   The optimizer also accesses indexes to check for supplied constants
+   whose values are outside the recorded range of the optimizer statistics
+   because the optimizer statistics might be stale.
+  </para>
+
+  <note>
+   <para>
+    The <structfield>idx_tup_read</structfield> and <structfield>idx_tup_fetch</structfield> counts
+    can be different even without any use of bitmap scans,
+    because <structfield>idx_tup_read</structfield> counts
+    index entries retrieved from the index while <structfield>idx_tup_fetch</structfield>
+    counts live rows fetched from the table.  The latter will be less if any
+    dead or not-yet-committed rows are fetched using the index, or if any
+    heap fetches are avoided by means of an index-only scan.
+   </para>
+  </note>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-all-tables-view">
+  <title><structname>pg_stat_all_tables</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_all_tables</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_all_tables</structname> view will contain
+   one row for each table in the current database (including TOAST
+   tables), showing statistics about accesses to that specific table. The
+   <structname>pg_stat_user_tables</structname> and
+   <structname>pg_stat_sys_tables</structname> views
+   contain the same information,
+   but filtered to only show user and system tables respectively.
+  </para>
 
+  <table id="pg-stat-all-tables-view" xreflabel="pg_stat_all_tables">
+   <title><structname>pg_stat_all_tables</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>backend_xmin</structfield> <type>xid</type>
+       Column Type
       </para>
       <para>
-       This standby's <literal>xmin</literal> horizon reported
-       by <xref linkend="guc-hot-standby-feedback"/>.
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>state</structfield> <type>text</type>
+       <structfield>relid</structfield> <type>oid</type>
       </para>
       <para>
-       Current WAL sender state.
-       Possible values are:
-       <itemizedlist>
-        <listitem>
-         <para>
-          <literal>startup</literal>: This WAL sender is starting up.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>catchup</literal>: This WAL sender's connected standby is
-          catching up with the primary.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>streaming</literal>: This WAL sender is streaming changes
-          after its connected standby server has caught up with the primary.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>backup</literal>: This WAL sender is sending a backup.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>stopping</literal>: This WAL sender is stopping.
-         </para>
-        </listitem>
-       </itemizedlist>
+       OID of a table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sent_lsn</structfield> <type>pg_lsn</type>
+       <structfield>schemaname</structfield> <type>name</type>
       </para>
       <para>
-       Last write-ahead log location sent on this connection
+       Name of the schema that this table is in
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>write_lsn</structfield> <type>pg_lsn</type>
+       <structfield>relname</structfield> <type>name</type>
       </para>
       <para>
-       Last write-ahead log location written to disk by this standby
-       server
+       Name of this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>flush_lsn</structfield> <type>pg_lsn</type>
+       <structfield>seq_scan</structfield> <type>bigint</type>
       </para>
       <para>
-       Last write-ahead log location flushed to disk by this standby
-       server
+       Number of sequential scans initiated on this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>replay_lsn</structfield> <type>pg_lsn</type>
+       <structfield>seq_tup_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Last write-ahead log location replayed into the database on this
-       standby server
+       Number of live rows fetched by sequential scans
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>write_lag</structfield> <type>interval</type>
+       <structfield>idx_scan</structfield> <type>bigint</type>
       </para>
       <para>
-       Time elapsed between flushing recent WAL locally and receiving
-       notification that this standby server has written it (but not yet
-       flushed it or applied it).  This can be used to gauge the delay that
-       <literal>synchronous_commit</literal> level
-       <literal>remote_write</literal> incurred while committing if this
-       server was configured as a synchronous standby.
+       Number of index scans initiated on this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>flush_lag</structfield> <type>interval</type>
+       <structfield>idx_tup_fetch</structfield> <type>bigint</type>
       </para>
       <para>
-       Time elapsed between flushing recent WAL locally and receiving
-       notification that this standby server has written and flushed it
-       (but not yet applied it).  This can be used to gauge the delay that
-       <literal>synchronous_commit</literal> level
-       <literal>on</literal> incurred while committing if this
-       server was configured as a synchronous standby.
+       Number of live rows fetched by index scans
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>replay_lag</structfield> <type>interval</type>
+       <structfield>n_tup_ins</structfield> <type>bigint</type>
       </para>
       <para>
-       Time elapsed between flushing recent WAL locally and receiving
-       notification that this standby server has written, flushed and
-       applied it.  This can be used to gauge the delay that
-       <literal>synchronous_commit</literal> level
-       <literal>remote_apply</literal> incurred while committing if this
-       server was configured as a synchronous standby.
+       Number of rows inserted
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sync_priority</structfield> <type>integer</type>
+       <structfield>n_tup_upd</structfield> <type>bigint</type>
       </para>
       <para>
-       Priority of this standby server for being chosen as the
-       synchronous standby in a priority-based synchronous replication.
-       This has no effect in a quorum-based synchronous replication.
+       Number of rows updated (includes <link linkend="storage-hot">HOT updated rows</link>)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sync_state</structfield> <type>text</type>
+       <structfield>n_tup_del</structfield> <type>bigint</type>
       </para>
       <para>
-       Synchronous state of this standby server.
-       Possible values are:
-       <itemizedlist>
-        <listitem>
-         <para>
-          <literal>async</literal>: This standby server is asynchronous.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>potential</literal>: This standby server is now asynchronous,
-          but can potentially become synchronous if one of current
-          synchronous ones fails.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>sync</literal>: This standby server is synchronous.
-         </para>
-        </listitem>
-        <listitem>
-         <para>
-          <literal>quorum</literal>: This standby server is considered as a candidate
-          for quorum standbys.
-         </para>
-        </listitem>
-       </itemizedlist>
+       Number of rows deleted
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>reply_time</structfield> <type>timestamp with time zone</type>
+       <structfield>n_tup_hot_upd</structfield> <type>bigint</type>
       </para>
       <para>
-       Send time of last reply message received from standby server
+       Number of rows HOT updated (i.e., with no separate index
+       update required)
       </para></entry>
      </row>
-    </tbody>
-   </tgroup>
-  </table>
 
-  <para>
-   The lag times reported in the <structname>pg_stat_replication</structname>
-   view are measurements of the time taken for recent WAL to be written,
-   flushed and replayed and for the sender to know about it.  These times
-   represent the commit delay that was (or would have been) introduced by each
-   synchronous commit level, if the remote server was configured as a
-   synchronous standby.  For an asynchronous standby, the
-   <structfield>replay_lag</structfield> column approximates the delay
-   before recent transactions became visible to queries.  If the standby
-   server has entirely caught up with the sending server and there is no more
-   WAL activity, the most recently measured lag times will continue to be
-   displayed for a short time and then show NULL.
-  </para>
-
-  <para>
-   Lag times work automatically for physical replication. Logical decoding
-   plugins may optionally emit tracking messages; if they do not, the tracking
-   mechanism will simply display NULL lag.
-  </para>
-
-  <note>
-   <para>
-    The reported lag times are not predictions of how long it will take for
-    the standby to catch up with the sending server assuming the current
-    rate of replay.  Such a system would show similar times while new WAL is
-    being generated, but would differ when the sender becomes idle.  In
-    particular, when the standby has caught up completely,
-    <structname>pg_stat_replication</structname> shows the time taken to
-    write, flush and replay the most recent reported WAL location rather than
-    zero as some users might expect.  This is consistent with the goal of
-    measuring synchronous commit and transaction visibility delays for
-    recent write transactions.
-    To reduce confusion for users expecting a different model of lag, the
-    lag columns revert to NULL after a short time on a fully replayed idle
-    system. Monitoring systems should choose whether to represent this
-    as missing data, zero or continue to display the last known value.
-   </para>
-  </note>
-
- </sect2>
-
- <sect2 id="monitoring-pg-stat-replication-slots-view">
-  <title><structname>pg_stat_replication_slots</structname></title>
-
-  <indexterm>
-   <primary>pg_stat_replication_slots</primary>
-  </indexterm>
-
-  <para>
-   The <structname>pg_stat_replication_slots</structname> view will contain
-   one row per logical replication slot, showing statistics about its usage.
-  </para>
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>n_live_tup</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Estimated number of live rows
+      </para></entry>
+     </row>
 
-  <table id="pg-stat-replication-slots-view" xreflabel="pg_stat_replication_slots">
-   <title><structname>pg_stat_replication_slots</structname> View</title>
-   <tgroup cols="1">
-    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        Column Type
-       </para>
-       <para>
-        Description
+       <structfield>n_dead_tup</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Estimated number of dead rows
       </para></entry>
      </row>
-    </thead>
 
-    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>slot_name</structfield> <type>text</type>
-       </para>
-       <para>
-        A unique, cluster-wide identifier for the replication slot
+       <structfield>n_mod_since_analyze</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Estimated number of rows modified since this table was last analyzed
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>spill_txns</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of transactions spilled to disk once the memory used by
-        logical decoding to decode changes from WAL has exceeded
-        <literal>logical_decoding_work_mem</literal>. The counter gets
-        incremented for both top-level transactions and subtransactions.
+       <structfield>n_ins_since_vacuum</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Estimated number of rows inserted since this table was last vacuumed
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>spill_count</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of times transactions were spilled to disk while decoding
-        changes from WAL for this slot. This counter is incremented each time
-        a transaction is spilled, and the same transaction may be spilled
-        multiple times.
+       <structfield>last_vacuum</structfield> <type>timestamp with time zone</type>
+      </para>
+      <para>
+       Last time at which this table was manually vacuumed
+       (not counting <command>VACUUM FULL</command>)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>spill_bytes</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Amount of decoded transaction data spilled to disk while performing
-        decoding of changes from WAL for this slot. This and other spill
-        counters can be used to gauge the I/O which occurred during logical
-        decoding and allow tuning <literal>logical_decoding_work_mem</literal>.
+       <structfield>last_autovacuum</structfield> <type>timestamp with time zone</type>
+      </para>
+      <para>
+       Last time at which this table was vacuumed by the autovacuum
+       daemon
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>stream_txns</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of in-progress transactions streamed to the decoding output
-        plugin after the memory used by logical decoding to decode changes
-        from WAL for this slot has exceeded
-        <literal>logical_decoding_work_mem</literal>. Streaming only
-        works with top-level transactions (subtransactions can't be streamed
-        independently), so the counter is not incremented for subtransactions.
-       </para></entry>
+       <structfield>last_analyze</structfield> <type>timestamp with time zone</type>
+      </para>
+      <para>
+       Last time at which this table was manually analyzed
+      </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>stream_count</structfield><type>bigint</type>
-       </para>
-       <para>
-        Number of times in-progress transactions were streamed to the decoding
-        output plugin while decoding changes from WAL for this slot. This
-        counter is incremented each time a transaction is streamed, and the
-        same transaction may be streamed multiple times.
+       <structfield>last_autoanalyze</structfield> <type>timestamp with time zone</type>
+      </para>
+      <para>
+       Last time at which this table was analyzed by the autovacuum
+       daemon
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>stream_bytes</structfield><type>bigint</type>
-       </para>
-       <para>
-        Amount of transaction data decoded for streaming in-progress
-        transactions to the decoding output plugin while decoding changes from
-        WAL for this slot. This and other streaming counters for this slot can
-        be used to tune <literal>logical_decoding_work_mem</literal>.
-       </para>
-      </entry>
+       <structfield>vacuum_count</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times this table has been manually vacuumed
+       (not counting <command>VACUUM FULL</command>)
+      </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>total_txns</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of decoded transactions sent to the decoding output plugin for
-        this slot. This counts top-level transactions only, and is not incremented
-        for subtransactions. Note that this includes the transactions that are
-        streamed and/or spilled.
-       </para></entry>
+       <structfield>autovacuum_count</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times this table has been vacuumed by the autovacuum
+       daemon
+      </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-        <structfield>total_bytes</structfield><type>bigint</type>
-       </para>
-       <para>
-        Amount of transaction data decoded for sending transactions to the
-        decoding output plugin while decoding changes from WAL for this slot.
-        Note that this includes data that is streamed and/or spilled.
-       </para>
-      </entry>
+       <structfield>analyze_count</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times this table has been manually analyzed
+      </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>
+       <structfield>autoanalyze_count</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times this table has been analyzed by the autovacuum
+       daemon
+      </para></entry>
      </row>
     </tbody>
    </tgroup>
@@ -2803,21 +2707,20 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
-  <title><structname>pg_stat_wal_receiver</structname></title>
+ <sect2 id="monitoring-pg-stat-archiver-view">
+  <title><structname>pg_stat_archiver</structname></title>
 
   <indexterm>
-   <primary>pg_stat_wal_receiver</primary>
+   <primary>pg_stat_archiver</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_wal_receiver</structname> view will contain only
-   one row, showing statistics about the WAL receiver from that receiver's
-   connected server.
+   The <structname>pg_stat_archiver</structname> view will always have a
+   single row, containing data about the archiver process of the cluster.
   </para>
 
-  <table id="pg-stat-wal-receiver-view" xreflabel="pg_stat_wal_receiver">
-   <title><structname>pg_stat_wal_receiver</structname> View</title>
+  <table id="pg-stat-archiver-view" xreflabel="pg_stat_archiver">
+   <title><structname>pg_stat_archiver</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -2833,295 +2736,211 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>pid</structfield> <type>integer</type>
-      </para>
-      <para>
-       Process ID of the WAL receiver process
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>status</structfield> <type>text</type>
+       <structfield>archived_count</structfield> <type>bigint</type>
       </para>
       <para>
-       Activity status of the WAL receiver process
+       Number of WAL files that have been successfully archived
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>receive_start_lsn</structfield> <type>pg_lsn</type>
+       <structfield>last_archived_wal</structfield> <type>text</type>
       </para>
       <para>
-       First write-ahead log location used when WAL receiver is
-       started
+       Name of the WAL file most recently successfully archived
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>receive_start_tli</structfield> <type>integer</type>
+       <structfield>last_archived_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       First timeline number used when WAL receiver is started
+       Time of the most recent successful archive operation
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>written_lsn</structfield> <type>pg_lsn</type>
+       <structfield>failed_count</structfield> <type>bigint</type>
       </para>
       <para>
-       Last write-ahead log location already received and written to disk,
-       but not flushed. This should not be used for data integrity checks.
+       Number of failed attempts for archiving WAL files
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>flushed_lsn</structfield> <type>pg_lsn</type>
+       <structfield>last_failed_wal</structfield> <type>text</type>
       </para>
       <para>
-       Last write-ahead log location already received and flushed to
-       disk, the initial value of this field being the first log location used
-       when WAL receiver is started
+       Name of the WAL file of the most recent failed archival operation
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>received_tli</structfield> <type>integer</type>
+       <structfield>last_failed_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Timeline number of last write-ahead log location received and
-       flushed to disk, the initial value of this field being the timeline
-       number of the first log location used when WAL receiver is started
+       Time of the most recent failed archival operation
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
+       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Send time of last message received from origin WAL sender
+       Time at which these statistics were last reset
       </para></entry>
      </row>
+    </tbody>
+   </tgroup>
+  </table>
 
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
-      </para>
-      <para>
-       Receipt time of last message received from origin WAL sender
-      </para></entry>
-     </row>
+  <para>
+    Normally, WAL files are archived in order, oldest to newest, but that is
+    not guaranteed, and does not hold under special circumstances like when
+    promoting a standby or after crash recovery. Therefore it is not safe to
+    assume that all files older than
+    <structfield>last_archived_wal</structfield> have also been successfully
+    archived.
+  </para>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-bgwriter-view">
+  <title><structname>pg_stat_bgwriter</structname></title>
 
+  <indexterm>
+   <primary>pg_stat_bgwriter</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_bgwriter</structname> view will always have a
+   single row, containing global data for the cluster.
+  </para>
+
+  <table id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter">
+   <title><structname>pg_stat_bgwriter</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
+       Column Type
       </para>
       <para>
-       Last write-ahead log location reported to origin WAL sender
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
+       <structfield>checkpoints_timed</structfield> <type>bigint</type>
       </para>
       <para>
-       Time of last write-ahead log location reported to origin WAL sender
+       Number of scheduled checkpoints that have been performed
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>slot_name</structfield> <type>text</type>
+       <structfield>checkpoints_req</structfield> <type>bigint</type>
       </para>
       <para>
-       Replication slot name used by this WAL receiver
+       Number of requested checkpoints that have been performed
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sender_host</structfield> <type>text</type>
+       <structfield>checkpoint_write_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Host of the <productname>PostgreSQL</productname> instance
-       this WAL receiver is connected to. This can be a host name,
-       an IP address, or a directory path if the connection is via
-       Unix socket.  (The path case can be distinguished because it
-       will always be an absolute path, beginning with <literal>/</literal>.)
+       Total amount of time that has been spent in the portion of
+       checkpoint processing where files are written to disk, in milliseconds
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sender_port</structfield> <type>integer</type>
+       <structfield>checkpoint_sync_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Port number of the <productname>PostgreSQL</productname> instance
-       this WAL receiver is connected to.
+       Total amount of time that has been spent in the portion of
+       checkpoint processing where files are synchronized to disk, in
+       milliseconds
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>conninfo</structfield> <type>text</type>
+       <structfield>buffers_checkpoint</structfield> <type>bigint</type>
       </para>
       <para>
-       Connection string used by this WAL receiver,
-       with security-sensitive fields obfuscated.
+       Number of buffers written during checkpoints
       </para></entry>
      </row>
-    </tbody>
-   </tgroup>
-  </table>
-
- </sect2>
-
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
-  <title><structname>pg_stat_recovery_prefetch</structname></title>
-
-  <indexterm>
-   <primary>pg_stat_recovery_prefetch</primary>
-  </indexterm>
-
-  <para>
-   The <structname>pg_stat_recovery_prefetch</structname> view will contain
-   only one row.  The columns <structfield>wal_distance</structfield>,
-   <structfield>block_distance</structfield> and
-   <structfield>io_depth</structfield> show current values, and the
-   other columns show cumulative counters that can be reset
-   with the <function>pg_stat_reset_shared</function> function.
-  </para>
 
-  <table id="pg-stat-recovery-prefetch-view" xreflabel="pg_stat_recovery_prefetch">
-   <title><structname>pg_stat_recovery_prefetch</structname> View</title>
-   <tgroup cols="1">
-    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       Column Type
+       <structfield>buffers_clean</structfield> <type>bigint</type>
       </para>
       <para>
-       Description
+       Number of buffers written by the background writer
       </para></entry>
      </row>
-    </thead>
-
-    <tbody>
-     <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>
-
-     <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>prefetch</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks prefetched because they were not in the buffer pool
-       </para>
-      </entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>hit</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks not prefetched because they were already in the buffer pool
-       </para>
-      </entry>
-     </row>
 
      <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>skip_init</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks not prefetched because they would be zero-initialized
-       </para>
-      </entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>skip_new</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks not prefetched because they didn't exist yet
-       </para>
-      </entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>skip_fpw</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks not prefetched because a full page image was included in the WAL
-       </para>
-      </entry>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>maxwritten_clean</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times the background writer stopped a cleaning
+       scan because it had written too many buffers
+      </para></entry>
      </row>
 
      <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>skip_rep</structfield> <type>bigint</type>
-       </para>
-       <para>
-        Number of blocks not prefetched because they were already recently prefetched
-       </para>
-      </entry>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>buffers_backend</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of buffers written directly by a backend
+      </para></entry>
      </row>
 
      <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>wal_distance</structfield> <type>int</type>
-       </para>
-       <para>
-        How many bytes ahead the prefetcher is looking
-       </para>
-      </entry>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>buffers_backend_fsync</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of times a backend had to execute its own
+       <function>fsync</function> call (normally the background writer handles those
+       even when the backend does its own write)
+      </para></entry>
      </row>
 
      <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>block_distance</structfield> <type>int</type>
-       </para>
-       <para>
-        How many blocks ahead the prefetcher is looking
-       </para>
-      </entry>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>buffers_alloc</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of buffers allocated
+      </para></entry>
      </row>
 
      <row>
-      <entry role="catalog_table_entry">
-       <para role="column_definition">
-        <structfield>io_depth</structfield> <type>int</type>
-       </para>
-       <para>
-        How many prefetches have been initiated but are not yet known to have completed
-       </para>
-      </entry>
+      <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>
@@ -3129,15 +2948,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-subscription">
-  <title><structname>pg_stat_subscription</structname></title>
+ <sect2 id="monitoring-pg-stat-database-view">
+  <title><structname>pg_stat_database</structname></title>
 
   <indexterm>
-   <primary>pg_stat_subscription</primary>
+   <primary>pg_stat_database</primary>
   </indexterm>
 
-  <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
-   <title><structname>pg_stat_subscription</structname> View</title>
+  <para>
+   The <structname>pg_stat_database</structname> view will contain one row
+   for each database in the cluster, plus one for shared objects, showing
+   database-wide statistics.
+  </para>
+
+  <table id="pg-stat-database-view" xreflabel="pg_stat_database">
+   <title><structname>pg_stat_database</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -3153,284 +2978,293 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>subid</structfield> <type>oid</type>
+       <structfield>datid</structfield> <type>oid</type>
       </para>
       <para>
-       OID of the subscription
+       OID of this database, or 0 for objects belonging to a shared
+       relation
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>subname</structfield> <type>name</type>
+       <structfield>datname</structfield> <type>name</type>
       </para>
       <para>
-       Name of the subscription
+       Name of this database, or <literal>NULL</literal> for shared
+       objects.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>pid</structfield> <type>integer</type>
+       <structfield>numbackends</structfield> <type>integer</type>
       </para>
       <para>
-       Process ID of the subscription worker process
+       Number of backends currently connected to this database, or
+       <literal>NULL</literal> for shared objects.  This is the only column
+       in this view that returns a value reflecting current state; all other
+       columns return the accumulated values since the last reset.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relid</structfield> <type>oid</type>
+       <structfield>xact_commit</structfield> <type>bigint</type>
       </para>
       <para>
-       OID of the relation that the worker is synchronizing; null for the
-       main apply worker
+       Number of transactions in this database that have been
+       committed
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>received_lsn</structfield> <type>pg_lsn</type>
+       <structfield>xact_rollback</structfield> <type>bigint</type>
       </para>
       <para>
-       Last write-ahead log location received, the initial value of
-       this field being 0
+       Number of transactions in this database that have been
+       rolled back
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
+       <structfield>blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Send time of last message received from origin WAL sender
+       Number of disk blocks read in this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
+       <structfield>blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Receipt time of last message received from origin WAL sender
+       Number of times disk blocks were found already in the buffer
+       cache, so that a read was not necessary (this only includes hits in the
+       PostgreSQL buffer cache, not the operating system's file system cache)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
+       <structfield>tup_returned</structfield> <type>bigint</type>
       </para>
       <para>
-       Last write-ahead log location reported to origin WAL sender
+       Number of live rows fetched by sequential scans and index entries returned by index scans in this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
+       <structfield>tup_fetched</structfield> <type>bigint</type>
       </para>
       <para>
-       Time of last write-ahead log location reported to origin WAL
-       sender
+       Number of live rows fetched by index scans in this database
       </para></entry>
      </row>
-    </tbody>
-   </tgroup>
-  </table>
-
- </sect2>
-
- <sect2 id="monitoring-pg-stat-subscription-stats">
-  <title><structname>pg_stat_subscription_stats</structname></title>
-
-  <indexterm>
-   <primary>pg_stat_subscription_stats</primary>
-  </indexterm>
-
-  <para>
-   The <structname>pg_stat_subscription_stats</structname> view will contain
-   one row per subscription.
-  </para>
 
-  <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
-   <title><structname>pg_stat_subscription_stats</structname> View</title>
-   <tgroup cols="1">
-    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       Column Type
+       <structfield>tup_inserted</structfield> <type>bigint</type>
       </para>
       <para>
-       Description
+       Number of rows inserted by queries in this database
       </para></entry>
      </row>
-    </thead>
 
-    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>subid</structfield> <type>oid</type>
+       <structfield>tup_updated</structfield> <type>bigint</type>
       </para>
       <para>
-       OID of the subscription
+       Number of rows updated by queries in this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>subname</structfield> <type>name</type>
+       <structfield>tup_deleted</structfield> <type>bigint</type>
       </para>
       <para>
-       Name of the subscription
+       Number of rows deleted by queries in this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>apply_error_count</structfield> <type>bigint</type>
+       <structfield>conflicts</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of times an error occurred while applying changes
+       Number of queries canceled due to conflicts with recovery
+       in this database. (Conflicts occur only on standby servers; see
+       <link linkend="monitoring-pg-stat-database-conflicts-view">
+       <structname>pg_stat_database_conflicts</structname></link> for details.)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sync_error_count</structfield> <type>bigint</type>
+       <structfield>temp_files</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of times an error occurred during the initial table
-       synchronization
+       Number of temporary files created by queries in this database.
+       All temporary files are counted, regardless of why the temporary file
+       was created (e.g., sorting or hashing), and regardless of the
+       <xref linkend="guc-log-temp-files"/> setting.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+       <structfield>temp_bytes</structfield> <type>bigint</type>
       </para>
       <para>
-       Time at which these statistics were last reset
+       Total amount of data written to temporary files by queries in
+       this database. All temporary files are counted, regardless of why
+       the temporary file was created, and
+       regardless of the <xref linkend="guc-log-temp-files"/> setting.
       </para></entry>
      </row>
-    </tbody>
-   </tgroup>
-  </table>
 
- </sect2>
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>deadlocks</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of deadlocks detected in this database
+      </para></entry>
+     </row>
 
- <sect2 id="monitoring-pg-stat-ssl-view">
-  <title><structname>pg_stat_ssl</structname></title>
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>checksum_failures</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of data page checksum failures detected in this
+       database (or on a shared object), or NULL if data checksums are not
+       enabled.
+      </para></entry>
+     </row>
 
-  <indexterm>
-   <primary>pg_stat_ssl</primary>
-  </indexterm>
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>checksum_last_failure</structfield> <type>timestamp with time zone</type>
+      </para>
+      <para>
+       Time at which the last data page checksum failure was detected in
+       this database (or on a shared object), or NULL if data checksums are not
+       enabled.
+      </para></entry>
+     </row>
 
-  <para>
-   The <structname>pg_stat_ssl</structname> view will contain one row per
-   backend or WAL sender process, showing statistics about SSL usage on
-   this connection. It can be joined to <structname>pg_stat_activity</structname>
-   or <structname>pg_stat_replication</structname> on the
-   <structfield>pid</structfield> column to get more details about the
-   connection.
-  </para>
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>blk_read_time</structfield> <type>double precision</type>
+      </para>
+      <para>
+       Time spent reading data file blocks by backends in this database,
+       in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled,
+       otherwise zero)
+      </para></entry>
+     </row>
 
-  <table id="pg-stat-ssl-view" xreflabel="pg_stat_ssl">
-   <title><structname>pg_stat_ssl</structname> View</title>
-   <tgroup cols="1">
-    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       Column Type
+       <structfield>blk_write_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Description
+       Time spent writing data file blocks by backends in this database,
+       in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled,
+       otherwise zero)
       </para></entry>
      </row>
-    </thead>
 
-    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>pid</structfield> <type>integer</type>
+       <structfield>session_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Process ID of a backend or WAL sender process
+       Time spent by database sessions in this database, in milliseconds
+       (note that statistics are only updated when the state of a session
+       changes, so if sessions have been idle for a long time, this idle time
+       won't be included)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>ssl</structfield> <type>boolean</type>
+       <structfield>active_time</structfield> <type>double precision</type>
       </para>
       <para>
-       True if SSL is used on this connection
+       Time spent executing SQL statements in this database, in milliseconds
+       (this corresponds to the states <literal>active</literal> and
+       <literal>fastpath function call</literal> in
+       <link linkend="monitoring-pg-stat-activity-view">
+       <structname>pg_stat_activity</structname></link>)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>version</structfield> <type>text</type>
+       <structfield>idle_in_transaction_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Version of SSL in use, or NULL if SSL is not in use
-       on this connection
+       Time spent idling while in a transaction in this database, in milliseconds
+       (this corresponds to the states <literal>idle in transaction</literal> and
+       <literal>idle in transaction (aborted)</literal> in
+       <link linkend="monitoring-pg-stat-activity-view">
+       <structname>pg_stat_activity</structname></link>)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>cipher</structfield> <type>text</type>
+       <structfield>sessions</structfield> <type>bigint</type>
       </para>
       <para>
-       Name of SSL cipher in use, or NULL if SSL is not in use
-       on this connection
+       Total number of sessions established to this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>bits</structfield> <type>integer</type>
+       <structfield>sessions_abandoned</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of bits in the encryption algorithm used, or NULL
-       if SSL is not used on this connection
+       Number of database sessions to this database that were terminated
+       because connection to the client was lost
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>client_dn</structfield> <type>text</type>
+       <structfield>sessions_fatal</structfield> <type>bigint</type>
       </para>
       <para>
-       Distinguished Name (DN) field from the client certificate
-       used, or NULL if no client certificate was supplied or if SSL
-       is not in use on this connection. This field is truncated if the
-       DN field is longer than <symbol>NAMEDATALEN</symbol> (64 characters
-       in a standard build).
+       Number of database sessions to this database that were terminated
+       by fatal errors
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>client_serial</structfield> <type>numeric</type>
+       <structfield>sessions_killed</structfield> <type>bigint</type>
       </para>
       <para>
-       Serial number of the client certificate, or NULL if no client
-       certificate was supplied or if SSL is not in use on this connection.  The
-       combination of certificate serial number and certificate issuer uniquely
-       identifies a certificate (unless the issuer erroneously reuses serial
-       numbers).
+       Number of database sessions to this database that were terminated
+       by operator intervention
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>issuer_dn</structfield> <type>text</type>
+       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       DN of the issuer of the client certificate, or NULL if no client
-       certificate was supplied or if SSL is not in use on this connection.
-       This field is truncated like <structfield>client_dn</structfield>.
+       Time at which these statistics were last reset
       </para></entry>
      </row>
     </tbody>
@@ -3439,24 +3273,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-gssapi-view">
-  <title><structname>pg_stat_gssapi</structname></title>
+ <sect2 id="monitoring-pg-stat-database-conflicts-view">
+  <title><structname>pg_stat_database_conflicts</structname></title>
 
   <indexterm>
-   <primary>pg_stat_gssapi</primary>
+   <primary>pg_stat_database_conflicts</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_gssapi</structname> view will contain one row per
-   backend, showing information about GSSAPI usage on this connection. It can
-   be joined to <structname>pg_stat_activity</structname> or
-   <structname>pg_stat_replication</structname> on the
-   <structfield>pid</structfield> column to get more details about the
-   connection.
+   The <structname>pg_stat_database_conflicts</structname> view will contain
+   one row per database, showing database-wide statistics about
+   query cancels occurring due to conflicts with recovery on standby servers.
+   This view will only contain information on standby servers, since
+   conflicts do not occur on primary servers.
   </para>
 
-  <table id="pg-stat-gssapi-view" xreflabel="pg_stat_gssapi">
-   <title><structname>pg_stat_gssapi</structname> View</title>
+  <table id="pg-stat-database-conflicts-view" xreflabel="pg_stat_database_conflicts">
+   <title><structname>pg_stat_database_conflicts</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -3472,40 +3305,69 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>pid</structfield> <type>integer</type>
+       <structfield>datid</structfield> <type>oid</type>
       </para>
       <para>
-       Process ID of a backend
+       OID of a database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>gss_authenticated</structfield> <type>boolean</type>
+       <structfield>datname</structfield> <type>name</type>
       </para>
       <para>
-       True if GSSAPI authentication was used for this connection
+       Name of this database
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>principal</structfield> <type>text</type>
+       <structfield>confl_tablespace</structfield> <type>bigint</type>
       </para>
       <para>
-       Principal used to authenticate this connection, or NULL
-       if GSSAPI was not used to authenticate this connection.  This
-       field is truncated if the principal is longer than
-       <symbol>NAMEDATALEN</symbol> (64 characters in a standard build).
+       Number of queries in this database that have been canceled due to
+       dropped tablespaces
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>encrypted</structfield> <type>boolean</type>
+       <structfield>confl_lock</structfield> <type>bigint</type>
       </para>
       <para>
-       True if GSSAPI encryption is in use on this connection
+       Number of queries in this database that have been canceled due to
+       lock timeouts
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>confl_snapshot</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of queries in this database that have been canceled due to
+       old snapshots
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>confl_bufferpin</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of queries in this database that have been canceled due to
+       pinned buffers
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>confl_deadlock</structfield> <type>bigint</type>
+      </para>
+      <para>
+       Number of queries in this database that have been canceled due to
+       deadlocks
       </para></entry>
      </row>
     </tbody>
@@ -3514,20 +3376,24 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-archiver-view">
-  <title><structname>pg_stat_archiver</structname></title>
+ <sect2 id="monitoring-pg-stat-gssapi-view">
+  <title><structname>pg_stat_gssapi</structname></title>
 
   <indexterm>
-   <primary>pg_stat_archiver</primary>
+   <primary>pg_stat_gssapi</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_archiver</structname> view will always have a
-   single row, containing data about the archiver process of the cluster.
+   The <structname>pg_stat_gssapi</structname> view will contain one row per
+   backend, showing information about GSSAPI usage on this connection. It can
+   be joined to <structname>pg_stat_activity</structname> or
+   <structname>pg_stat_replication</structname> on the
+   <structfield>pid</structfield> column to get more details about the
+   connection.
   </para>
 
-  <table id="pg-stat-archiver-view" xreflabel="pg_stat_archiver">
-   <title><structname>pg_stat_archiver</structname> View</title>
+  <table id="pg-stat-gssapi-view" xreflabel="pg_stat_gssapi">
+   <title><structname>pg_stat_gssapi</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -3543,95 +3409,210 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>archived_count</structfield> <type>bigint</type>
+       <structfield>pid</structfield> <type>integer</type>
       </para>
       <para>
-       Number of WAL files that have been successfully archived
+       Process ID of a backend
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_archived_wal</structfield> <type>text</type>
+       <structfield>gss_authenticated</structfield> <type>boolean</type>
       </para>
       <para>
-       Name of the WAL file most recently successfully archived
+       True if GSSAPI authentication was used for this connection
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_archived_time</structfield> <type>timestamp with time zone</type>
+       <structfield>principal</structfield> <type>text</type>
       </para>
       <para>
-       Time of the most recent successful archive operation
+       Principal used to authenticate this connection, or NULL
+       if GSSAPI was not used to authenticate this connection.  This
+       field is truncated if the principal is longer than
+       <symbol>NAMEDATALEN</symbol> (64 characters in a standard build).
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>failed_count</structfield> <type>bigint</type>
+       <structfield>encrypted</structfield> <type>boolean</type>
       </para>
       <para>
-       Number of failed attempts for archiving WAL files
+       True if GSSAPI encryption is in use on this connection
       </para></entry>
      </row>
+    </tbody>
+   </tgroup>
+  </table>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-recovery-prefetch">
+  <title><structname>pg_stat_recovery_prefetch</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_recovery_prefetch</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_recovery_prefetch</structname> view will contain
+   only one row.  The columns <structfield>wal_distance</structfield>,
+   <structfield>block_distance</structfield> and
+   <structfield>io_depth</structfield> show current values, and the
+   other columns show cumulative counters that can be reset
+   with the <function>pg_stat_reset_shared</function> function.
+  </para>
 
+  <table id="pg-stat-recovery-prefetch-view" xreflabel="pg_stat_recovery_prefetch">
+   <title><structname>pg_stat_recovery_prefetch</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_failed_wal</structfield> <type>text</type>
+       Column Type
       </para>
       <para>
-       Name of the WAL file of the most recent failed archival operation
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_failed_time</structfield> <type>timestamp with time zone</type>
-      </para>
-      <para>
-       Time of the most recent failed archival operation
-      </para></entry>
+      <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>
 
      <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>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>prefetch</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks prefetched because they were not in the buffer pool
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>hit</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks not prefetched because they were already in the buffer pool
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>skip_init</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks not prefetched because they would be zero-initialized
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>skip_new</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks not prefetched because they didn't exist yet
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>skip_fpw</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks not prefetched because a full page image was included in the WAL
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>skip_rep</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of blocks not prefetched because they were already recently prefetched
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>wal_distance</structfield> <type>int</type>
+       </para>
+       <para>
+        How many bytes ahead the prefetcher is looking
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>block_distance</structfield> <type>int</type>
+       </para>
+       <para>
+        How many blocks ahead the prefetcher is looking
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>io_depth</structfield> <type>int</type>
+       </para>
+       <para>
+        How many prefetches have been initiated but are not yet known to have completed
+       </para>
+      </entry>
      </row>
     </tbody>
    </tgroup>
   </table>
 
-  <para>
-    Normally, WAL files are archived in order, oldest to newest, but that is
-    not guaranteed, and does not hold under special circumstances like when
-    promoting a standby or after crash recovery. Therefore it is not safe to
-    assume that all files older than
-    <structfield>last_archived_wal</structfield> have also been successfully
-    archived.
-  </para>
-
  </sect2>
 
- <sect2 id="monitoring-pg-stat-bgwriter-view">
-  <title><structname>pg_stat_bgwriter</structname></title>
+ <sect2 id="monitoring-pg-stat-replication-view">
+  <title><structname>pg_stat_replication</structname></title>
 
   <indexterm>
-   <primary>pg_stat_bgwriter</primary>
+   <primary>pg_stat_replication</primary>
   </indexterm>
 
-  <para>
-   The <structname>pg_stat_bgwriter</structname> view will always have a
-   single row, containing global data for the cluster.
+   <para>
+   The <structname>pg_stat_replication</structname> view will contain one row
+   per WAL sender process, showing statistics about replication to that
+   sender's connected standby server.  Only directly connected standbys are
+   listed; no information is available about downstream standby servers.
   </para>
 
-  <table id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter">
-   <title><structname>pg_stat_bgwriter</structname> View</title>
+  <table id="pg-stat-replication-view" xreflabel="pg_stat_replication">
+   <title><structname>pg_stat_replication</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -3647,271 +3628,334 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checkpoints_timed</structfield> <type>bigint</type>
+       <structfield>pid</structfield> <type>integer</type>
       </para>
       <para>
-       Number of scheduled checkpoints that have been performed
+       Process ID of a WAL sender process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checkpoints_req</structfield> <type>bigint</type>
+       <structfield>usesysid</structfield> <type>oid</type>
       </para>
       <para>
-       Number of requested checkpoints that have been performed
+       OID of the user logged into this WAL sender process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checkpoint_write_time</structfield> <type>double precision</type>
+       <structfield>usename</structfield> <type>name</type>
       </para>
       <para>
-       Total amount of time that has been spent in the portion of
-       checkpoint processing where files are written to disk, in milliseconds
+       Name of the user logged into this WAL sender process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checkpoint_sync_time</structfield> <type>double precision</type>
+       <structfield>application_name</structfield> <type>text</type>
       </para>
       <para>
-       Total amount of time that has been spent in the portion of
-       checkpoint processing where files are synchronized to disk, in
-       milliseconds
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>buffers_checkpoint</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of buffers written during checkpoints
+       Name of the application that is connected
+       to this WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>buffers_clean</structfield> <type>bigint</type>
+       <structfield>client_addr</structfield> <type>inet</type>
       </para>
       <para>
-       Number of buffers written by the background writer
+       IP address of the client connected to this WAL sender.
+       If this field is null, it indicates that the client is
+       connected via a Unix socket on the server machine.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>maxwritten_clean</structfield> <type>bigint</type>
+       <structfield>client_hostname</structfield> <type>text</type>
       </para>
       <para>
-       Number of times the background writer stopped a cleaning
-       scan because it had written too many buffers
+       Host name of the connected client, as reported by a
+       reverse DNS lookup of <structfield>client_addr</structfield>. This field will
+       only be non-null for IP connections, and only when <xref linkend="guc-log-hostname"/> is enabled.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>buffers_backend</structfield> <type>bigint</type>
+       <structfield>client_port</structfield> <type>integer</type>
       </para>
       <para>
-       Number of buffers written directly by a backend
+       TCP port number that the client is using for communication
+       with this WAL sender, or <literal>-1</literal> if a Unix socket is used
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>buffers_backend_fsync</structfield> <type>bigint</type>
+       <structfield>backend_start</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of times a backend had to execute its own
-       <function>fsync</function> call (normally the background writer handles those
-       even when the backend does its own write)
+       Time when this process was started, i.e., when the
+       client connected to this WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>buffers_alloc</structfield> <type>bigint</type>
+       <structfield>backend_xmin</structfield> <type>xid</type>
       </para>
       <para>
-       Number of buffers allocated
+       This standby's <literal>xmin</literal> horizon reported
+       by <xref linkend="guc-hot-standby-feedback"/>.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+       <structfield>state</structfield> <type>text</type>
       </para>
       <para>
-       Time at which these statistics were last reset
+       Current WAL sender state.
+       Possible values are:
+       <itemizedlist>
+        <listitem>
+         <para>
+          <literal>startup</literal>: This WAL sender is starting up.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>catchup</literal>: This WAL sender's connected standby is
+          catching up with the primary.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>streaming</literal>: This WAL sender is streaming changes
+          after its connected standby server has caught up with the primary.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>backup</literal>: This WAL sender is sending a backup.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>stopping</literal>: This WAL sender is stopping.
+         </para>
+        </listitem>
+       </itemizedlist>
       </para></entry>
      </row>
-    </tbody>
-   </tgroup>
-  </table>
 
- </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
+       <structfield>sent_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Description
+       Last write-ahead log location sent on this connection
       </para></entry>
      </row>
-    </thead>
 
-    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_records</structfield> <type>bigint</type>
+       <structfield>write_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Total number of WAL records generated
+       Last write-ahead log location written to disk by this standby
+       server
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_fpi</structfield> <type>bigint</type>
+       <structfield>flush_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Total number of WAL full page images generated
+       Last write-ahead log location flushed to disk by this standby
+       server
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_bytes</structfield> <type>numeric</type>
+       <structfield>replay_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Total amount of WAL generated in bytes
+       Last write-ahead log location replayed into the database on this
+       standby server
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_buffers_full</structfield> <type>bigint</type>
+       <structfield>write_lag</structfield> <type>interval</type>
       </para>
       <para>
-       Number of times WAL data was written to disk because WAL buffers became full
+       Time elapsed between flushing recent WAL locally and receiving
+       notification that this standby server has written it (but not yet
+       flushed it or applied it).  This can be used to gauge the delay that
+       <literal>synchronous_commit</literal> level
+       <literal>remote_write</literal> incurred while committing if this
+       server was configured as a synchronous standby.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_write</structfield> <type>bigint</type>
+       <structfield>flush_lag</structfield> <type>interval</type>
       </para>
       <para>
-       Number of times WAL buffers were written out to disk via
-       <function>XLogWrite</function> request.
-       See <xref linkend="wal-configuration"/> for more information about
-       the internal WAL function <function>XLogWrite</function>.
+       Time elapsed between flushing recent WAL locally and receiving
+       notification that this standby server has written and flushed it
+       (but not yet applied it).  This can be used to gauge the delay that
+       <literal>synchronous_commit</literal> level
+       <literal>on</literal> incurred while committing if this
+       server was configured as a synchronous standby.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_sync</structfield> <type>bigint</type>
+       <structfield>replay_lag</structfield> <type>interval</type>
       </para>
       <para>
-       Number of times WAL files were synced to disk via
-       <function>issue_xlog_fsync</function> request
-       (if <xref linkend="guc-fsync"/> is <literal>on</literal> and
-       <xref linkend="guc-wal-sync-method"/> is either
-       <literal>fdatasync</literal>, <literal>fsync</literal> or
-       <literal>fsync_writethrough</literal>, otherwise zero).
-       See <xref linkend="wal-configuration"/> for more information about
-       the internal WAL function <function>issue_xlog_fsync</function>.
+       Time elapsed between flushing recent WAL locally and receiving
+       notification that this standby server has written, flushed and
+       applied it.  This can be used to gauge the delay that
+       <literal>synchronous_commit</literal> level
+       <literal>remote_apply</literal> incurred while committing if this
+       server was configured as a synchronous standby.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_write_time</structfield> <type>double precision</type>
+       <structfield>sync_priority</structfield> <type>integer</type>
       </para>
       <para>
-       Total amount of time spent writing WAL buffers to disk via
-       <function>XLogWrite</function> request, in milliseconds
-       (if <xref linkend="guc-track-wal-io-timing"/> is enabled,
-       otherwise zero).  This includes the sync time when
-       <varname>wal_sync_method</varname> is either
-       <literal>open_datasync</literal> or <literal>open_sync</literal>.
+       Priority of this standby server for being chosen as the
+       synchronous standby in a priority-based synchronous replication.
+       This has no effect in a quorum-based synchronous replication.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>wal_sync_time</structfield> <type>double precision</type>
+       <structfield>sync_state</structfield> <type>text</type>
       </para>
       <para>
-       Total amount of time spent syncing WAL files to disk via
-       <function>issue_xlog_fsync</function> request, in milliseconds
-       (if <varname>track_wal_io_timing</varname> is enabled,
-       <varname>fsync</varname> is <literal>on</literal>, and
-       <varname>wal_sync_method</varname> is either
-       <literal>fdatasync</literal>, <literal>fsync</literal> or
-       <literal>fsync_writethrough</literal>, otherwise zero).
+       Synchronous state of this standby server.
+       Possible values are:
+       <itemizedlist>
+        <listitem>
+         <para>
+          <literal>async</literal>: This standby server is asynchronous.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>potential</literal>: This standby server is now asynchronous,
+          but can potentially become synchronous if one of current
+          synchronous ones fails.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>sync</literal>: This standby server is synchronous.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>quorum</literal>: This standby server is considered as a candidate
+          for quorum standbys.
+         </para>
+        </listitem>
+       </itemizedlist>
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+       <structfield>reply_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Time at which these statistics were last reset
+       Send time of last reply message received from standby server
       </para></entry>
      </row>
-     </tbody>
+    </tbody>
    </tgroup>
   </table>
 
-</sect2>
+  <para>
+   The lag times reported in the <structname>pg_stat_replication</structname>
+   view are measurements of the time taken for recent WAL to be written,
+   flushed and replayed and for the sender to know about it.  These times
+   represent the commit delay that was (or would have been) introduced by each
+   synchronous commit level, if the remote server was configured as a
+   synchronous standby.  For an asynchronous standby, the
+   <structfield>replay_lag</structfield> column approximates the delay
+   before recent transactions became visible to queries.  If the standby
+   server has entirely caught up with the sending server and there is no more
+   WAL activity, the most recently measured lag times will continue to be
+   displayed for a short time and then show NULL.
+  </para>
 
- <sect2 id="monitoring-pg-stat-database-view">
-  <title><structname>pg_stat_database</structname></title>
+  <para>
+   Lag times work automatically for physical replication. Logical decoding
+   plugins may optionally emit tracking messages; if they do not, the tracking
+   mechanism will simply display NULL lag.
+  </para>
+
+  <note>
+   <para>
+    The reported lag times are not predictions of how long it will take for
+    the standby to catch up with the sending server assuming the current
+    rate of replay.  Such a system would show similar times while new WAL is
+    being generated, but would differ when the sender becomes idle.  In
+    particular, when the standby has caught up completely,
+    <structname>pg_stat_replication</structname> shows the time taken to
+    write, flush and replay the most recent reported WAL location rather than
+    zero as some users might expect.  This is consistent with the goal of
+    measuring synchronous commit and transaction visibility delays for
+    recent write transactions.
+    To reduce confusion for users expecting a different model of lag, the
+    lag columns revert to NULL after a short time on a fully replayed idle
+    system. Monitoring systems should choose whether to represent this
+    as missing data, zero or continue to display the last known value.
+   </para>
+  </note>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-replication-slots-view">
+  <title><structname>pg_stat_replication_slots</structname></title>
 
   <indexterm>
-   <primary>pg_stat_database</primary>
+   <primary>pg_stat_replication_slots</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_database</structname> view will contain one row
-   for each database in the cluster, plus one for shared objects, showing
-   database-wide statistics.
+   The <structname>pg_stat_replication_slots</structname> view will contain
+   one row per logical replication slot, showing statistics about its usage.
   </para>
 
-  <table id="pg-stat-database-view" xreflabel="pg_stat_database">
-   <title><structname>pg_stat_database</structname> View</title>
+  <table id="pg-stat-replication-slots-view" xreflabel="pg_stat_replication_slots">
+   <title><structname>pg_stat_replication_slots</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       Column Type
-      </para>
-      <para>
-       Description
+        Column Type
+       </para>
+       <para>
+        Description
       </para></entry>
      </row>
     </thead>
@@ -3919,284 +3963,231 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>datid</structfield> <type>oid</type>
-      </para>
-      <para>
-       OID of this database, or 0 for objects belonging to a shared
-       relation
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>datname</structfield> <type>name</type>
-      </para>
-      <para>
-       Name of this database, or <literal>NULL</literal> for shared
-       objects.
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>numbackends</structfield> <type>integer</type>
-      </para>
-      <para>
-       Number of backends currently connected to this database, or
-       <literal>NULL</literal> for shared objects.  This is the only column
-       in this view that returns a value reflecting current state; all other
-       columns return the accumulated values since the last reset.
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>xact_commit</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of transactions in this database that have been
-       committed
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>xact_rollback</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of transactions in this database that have been
-       rolled back
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_read</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of disk blocks read in this database
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_hit</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of times disk blocks were found already in the buffer
-       cache, so that a read was not necessary (this only includes hits in the
-       PostgreSQL buffer cache, not the operating system's file system cache)
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tup_returned</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of live rows fetched by sequential scans and index entries returned by index scans in this database
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tup_fetched</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of live rows fetched by index scans in this database
+        <structfield>slot_name</structfield> <type>text</type>
+       </para>
+       <para>
+        A unique, cluster-wide identifier for the replication slot
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tup_inserted</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of rows inserted by queries in this database
+        <structfield>spill_txns</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of transactions spilled to disk once the memory used by
+        logical decoding to decode changes from WAL has exceeded
+        <literal>logical_decoding_work_mem</literal>. The counter gets
+        incremented for both top-level transactions and subtransactions.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tup_updated</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of rows updated by queries in this database
+        <structfield>spill_count</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of times transactions were spilled to disk while decoding
+        changes from WAL for this slot. This counter is incremented each time
+        a transaction is spilled, and the same transaction may be spilled
+        multiple times.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tup_deleted</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of rows deleted by queries in this database
+        <structfield>spill_bytes</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Amount of decoded transaction data spilled to disk while performing
+        decoding of changes from WAL for this slot. This and other spill
+        counters can be used to gauge the I/O which occurred during logical
+        decoding and allow tuning <literal>logical_decoding_work_mem</literal>.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>conflicts</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of queries canceled due to conflicts with recovery
-       in this database. (Conflicts occur only on standby servers; see
-       <link linkend="monitoring-pg-stat-database-conflicts-view">
-       <structname>pg_stat_database_conflicts</structname></link> for details.)
-      </para></entry>
+        <structfield>stream_txns</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of in-progress transactions streamed to the decoding output
+        plugin after the memory used by logical decoding to decode changes
+        from WAL for this slot has exceeded
+        <literal>logical_decoding_work_mem</literal>. Streaming only
+        works with top-level transactions (subtransactions can't be streamed
+        independently), so the counter is not incremented for subtransactions.
+       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>temp_files</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of temporary files created by queries in this database.
-       All temporary files are counted, regardless of why the temporary file
-       was created (e.g., sorting or hashing), and regardless of the
-       <xref linkend="guc-log-temp-files"/> setting.
+        <structfield>stream_count</structfield><type>bigint</type>
+       </para>
+       <para>
+        Number of times in-progress transactions were streamed to the decoding
+        output plugin while decoding changes from WAL for this slot. This
+        counter is incremented each time a transaction is streamed, and the
+        same transaction may be streamed multiple times.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>temp_bytes</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Total amount of data written to temporary files by queries in
-       this database. All temporary files are counted, regardless of why
-       the temporary file was created, and
-       regardless of the <xref linkend="guc-log-temp-files"/> setting.
-      </para></entry>
+        <structfield>stream_bytes</structfield><type>bigint</type>
+       </para>
+       <para>
+        Amount of transaction data decoded for streaming in-progress
+        transactions to the decoding output plugin while decoding changes from
+        WAL for this slot. This and other streaming counters for this slot can
+        be used to tune <literal>logical_decoding_work_mem</literal>.
+       </para>
+      </entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>deadlocks</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of deadlocks detected in this database
-      </para></entry>
+        <structfield>total_txns</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of decoded transactions sent to the decoding output plugin for
+        this slot. This counts top-level transactions only, and is not incremented
+        for subtransactions. Note that this includes the transactions that are
+        streamed and/or spilled.
+       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checksum_failures</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of data page checksum failures detected in this
-       database (or on a shared object), or NULL if data checksums are not
-       enabled.
-      </para></entry>
+        <structfield>total_bytes</structfield><type>bigint</type>
+       </para>
+       <para>
+        Amount of transaction data decoded for sending transactions to the
+        decoding output plugin while decoding changes from WAL for this slot.
+        Note that this includes data that is streamed and/or spilled.
+       </para>
+      </entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>checksum_last_failure</structfield> <type>timestamp with time zone</type>
-      </para>
-      <para>
-       Time at which the last data page checksum failure was detected in
-       this database (or on a shared object), or NULL if data checksums are not
-       enabled.
-      </para></entry>
+        <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-slru-view">
+  <title><structname>pg_stat_slru</structname></title>
+
+  <indexterm>
+   <primary>SLRU</primary>
+  </indexterm>
+
+  <indexterm>
+   <primary>pg_stat_slru</primary>
+  </indexterm>
+
+  <para>
+   <productname>PostgreSQL</productname> accesses certain on-disk information
+   via <firstterm>SLRU</firstterm> (simple least-recently-used) caches.
+   The <structname>pg_stat_slru</structname> view will contain
+   one row for each tracked SLRU cache, showing statistics about access
+   to cached pages.
+  </para>
+
+  <table id="pg-stat-slru-view" xreflabel="pg_stat_slru">
+   <title><structname>pg_stat_slru</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blk_read_time</structfield> <type>double precision</type>
+       Column Type
       </para>
       <para>
-       Time spent reading data file blocks by backends in this database,
-       in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled,
-       otherwise zero)
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blk_write_time</structfield> <type>double precision</type>
+       <structfield>name</structfield> <type>text</type>
       </para>
       <para>
-       Time spent writing data file blocks by backends in this database,
-       in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled,
-       otherwise zero)
+       Name of the SLRU
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>session_time</structfield> <type>double precision</type>
+       <structfield>blks_zeroed</structfield> <type>bigint</type>
       </para>
       <para>
-       Time spent by database sessions in this database, in milliseconds
-       (note that statistics are only updated when the state of a session
-       changes, so if sessions have been idle for a long time, this idle time
-       won't be included)
+       Number of blocks zeroed during initializations
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>active_time</structfield> <type>double precision</type>
+       <structfield>blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Time spent executing SQL statements in this database, in milliseconds
-       (this corresponds to the states <literal>active</literal> and
-       <literal>fastpath function call</literal> in
-       <link linkend="monitoring-pg-stat-activity-view">
-       <structname>pg_stat_activity</structname></link>)
+       Number of times disk blocks were found already in the SLRU,
+       so that a read was not necessary (this only includes hits in the
+       SLRU, not the operating system's file system cache)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idle_in_transaction_time</structfield> <type>double precision</type>
+       <structfield>blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Time spent idling while in a transaction in this database, in milliseconds
-       (this corresponds to the states <literal>idle in transaction</literal> and
-       <literal>idle in transaction (aborted)</literal> in
-       <link linkend="monitoring-pg-stat-activity-view">
-       <structname>pg_stat_activity</structname></link>)
+       Number of disk blocks read for this SLRU
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sessions</structfield> <type>bigint</type>
+       <structfield>blks_written</structfield> <type>bigint</type>
       </para>
       <para>
-       Total number of sessions established to this database
+       Number of disk blocks written for this SLRU
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sessions_abandoned</structfield> <type>bigint</type>
+       <structfield>blks_exists</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of database sessions to this database that were terminated
-       because connection to the client was lost
+       Number of blocks checked for existence for this SLRU
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sessions_fatal</structfield> <type>bigint</type>
+       <structfield>flushes</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of database sessions to this database that were terminated
-       by fatal errors
+       Number of flushes of dirty data for this SLRU
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>sessions_killed</structfield> <type>bigint</type>
+       <structfield>truncates</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of database sessions to this database that were terminated
-       by operator intervention
+       Number of truncates for this SLRU
       </para></entry>
      </row>
 
@@ -4214,23 +4205,24 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
-  <title><structname>pg_stat_database_conflicts</structname></title>
+ <sect2 id="monitoring-pg-stat-ssl-view">
+  <title><structname>pg_stat_ssl</structname></title>
 
   <indexterm>
-   <primary>pg_stat_database_conflicts</primary>
+   <primary>pg_stat_ssl</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_database_conflicts</structname> view will contain
-   one row per database, showing database-wide statistics about
-   query cancels occurring due to conflicts with recovery on standby servers.
-   This view will only contain information on standby servers, since
-   conflicts do not occur on primary servers.
+   The <structname>pg_stat_ssl</structname> view will contain one row per
+   backend or WAL sender process, showing statistics about SSL usage on
+   this connection. It can be joined to <structname>pg_stat_activity</structname>
+   or <structname>pg_stat_replication</structname> on the
+   <structfield>pid</structfield> column to get more details about the
+   connection.
   </para>
 
-  <table id="pg-stat-database-conflicts-view" xreflabel="pg_stat_database_conflicts">
-   <title><structname>pg_stat_database_conflicts</structname> View</title>
+  <table id="pg-stat-ssl-view" xreflabel="pg_stat_ssl">
+   <title><structname>pg_stat_ssl</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -4246,69 +4238,86 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>datid</structfield> <type>oid</type>
+       <structfield>pid</structfield> <type>integer</type>
       </para>
       <para>
-       OID of a database
+       Process ID of a backend or WAL sender process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>datname</structfield> <type>name</type>
+       <structfield>ssl</structfield> <type>boolean</type>
       </para>
       <para>
-       Name of this database
+       True if SSL is used on this connection
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>confl_tablespace</structfield> <type>bigint</type>
+       <structfield>version</structfield> <type>text</type>
       </para>
       <para>
-       Number of queries in this database that have been canceled due to
-       dropped tablespaces
+       Version of SSL in use, or NULL if SSL is not in use
+       on this connection
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>confl_lock</structfield> <type>bigint</type>
+       <structfield>cipher</structfield> <type>text</type>
       </para>
       <para>
-       Number of queries in this database that have been canceled due to
-       lock timeouts
+       Name of SSL cipher in use, or NULL if SSL is not in use
+       on this connection
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>confl_snapshot</structfield> <type>bigint</type>
+       <structfield>bits</structfield> <type>integer</type>
       </para>
       <para>
-       Number of queries in this database that have been canceled due to
-       old snapshots
+       Number of bits in the encryption algorithm used, or NULL
+       if SSL is not used on this connection
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>confl_bufferpin</structfield> <type>bigint</type>
+       <structfield>client_dn</structfield> <type>text</type>
       </para>
       <para>
-       Number of queries in this database that have been canceled due to
-       pinned buffers
+       Distinguished Name (DN) field from the client certificate
+       used, or NULL if no client certificate was supplied or if SSL
+       is not in use on this connection. This field is truncated if the
+       DN field is longer than <symbol>NAMEDATALEN</symbol> (64 characters
+       in a standard build).
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>confl_deadlock</structfield> <type>bigint</type>
+       <structfield>client_serial</structfield> <type>numeric</type>
       </para>
       <para>
-       Number of queries in this database that have been canceled due to
-       deadlocks
+       Serial number of the client certificate, or NULL if no client
+       certificate was supplied or if SSL is not in use on this connection.  The
+       combination of certificate serial number and certificate issuer uniquely
+       identifies a certificate (unless the issuer erroneously reuses serial
+       numbers).
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>issuer_dn</structfield> <type>text</type>
+      </para>
+      <para>
+       DN of the issuer of the client certificate, or NULL if no client
+       certificate was supplied or if SSL is not in use on this connection.
+       This field is truncated like <structfield>client_dn</structfield>.
       </para></entry>
      </row>
     </tbody>
@@ -4317,25 +4326,15 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-all-tables-view">
-  <title><structname>pg_stat_all_tables</structname></title>
+ <sect2 id="monitoring-pg-stat-subscription">
+  <title><structname>pg_stat_subscription</structname></title>
 
   <indexterm>
-   <primary>pg_stat_all_tables</primary>
+   <primary>pg_stat_subscription</primary>
   </indexterm>
 
-  <para>
-   The <structname>pg_stat_all_tables</structname> view will contain
-   one row for each table in the current database (including TOAST
-   tables), showing statistics about accesses to that specific table. The
-   <structname>pg_stat_user_tables</structname> and
-   <structname>pg_stat_sys_tables</structname> views
-   contain the same information,
-   but filtered to only show user and system tables respectively.
-  </para>
-
-  <table id="pg-stat-all-tables-view" xreflabel="pg_stat_all_tables">
-   <title><structname>pg_stat_all_tables</structname> View</title>
+  <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+   <title><structname>pg_stat_subscription</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -4351,215 +4350,253 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relid</structfield> <type>oid</type>
-      </para>
-      <para>
-       OID of a table
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>schemaname</structfield> <type>name</type>
+       <structfield>subid</structfield> <type>oid</type>
       </para>
       <para>
-       Name of the schema that this table is in
+       OID of the subscription
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relname</structfield> <type>name</type>
+       <structfield>subname</structfield> <type>name</type>
       </para>
       <para>
-       Name of this table
+       Name of the subscription
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>seq_scan</structfield> <type>bigint</type>
+       <structfield>pid</structfield> <type>integer</type>
       </para>
       <para>
-       Number of sequential scans initiated on this table
+       Process ID of the subscription worker process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>seq_tup_read</structfield> <type>bigint</type>
+       <structfield>relid</structfield> <type>oid</type>
       </para>
       <para>
-       Number of live rows fetched by sequential scans
+       OID of the relation that the worker is synchronizing; null for the
+       main apply worker
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_scan</structfield> <type>bigint</type>
+       <structfield>received_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Number of index scans initiated on this table
+       Last write-ahead log location received, the initial value of
+       this field being 0
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_tup_fetch</structfield> <type>bigint</type>
+       <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of live rows fetched by index scans
+       Send time of last message received from origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_tup_ins</structfield> <type>bigint</type>
+       <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of rows inserted
+       Receipt time of last message received from origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_tup_upd</structfield> <type>bigint</type>
+       <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Number of rows updated (includes <link linkend="storage-hot">HOT updated rows</link>)
+       Last write-ahead log location reported to origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_tup_del</structfield> <type>bigint</type>
+       <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of rows deleted
+       Time of last write-ahead log location reported to origin WAL
+       sender
       </para></entry>
      </row>
+    </tbody>
+   </tgroup>
+  </table>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-subscription-stats">
+  <title><structname>pg_stat_subscription_stats</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_subscription_stats</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_subscription_stats</structname> view will contain
+   one row per subscription.
+  </para>
 
+  <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
+   <title><structname>pg_stat_subscription_stats</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_tup_hot_upd</structfield> <type>bigint</type>
+       Column Type
       </para>
       <para>
-       Number of rows HOT updated (i.e., with no separate index
-       update required)
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_live_tup</structfield> <type>bigint</type>
+       <structfield>subid</structfield> <type>oid</type>
       </para>
       <para>
-       Estimated number of live rows
+       OID of the subscription
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_dead_tup</structfield> <type>bigint</type>
+       <structfield>subname</structfield> <type>name</type>
       </para>
       <para>
-       Estimated number of dead rows
+       Name of the subscription
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_mod_since_analyze</structfield> <type>bigint</type>
+       <structfield>apply_error_count</structfield> <type>bigint</type>
       </para>
       <para>
-       Estimated number of rows modified since this table was last analyzed
+       Number of times an error occurred while applying changes
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>n_ins_since_vacuum</structfield> <type>bigint</type>
+       <structfield>sync_error_count</structfield> <type>bigint</type>
       </para>
       <para>
-       Estimated number of rows inserted since this table was last vacuumed
+       Number of times an error occurred during the initial table
+       synchronization
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_vacuum</structfield> <type>timestamp with time zone</type>
+       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Last time at which this table was manually vacuumed
-       (not counting <command>VACUUM FULL</command>)
+       Time at which these statistics were last reset
       </para></entry>
      </row>
+    </tbody>
+   </tgroup>
+  </table>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-user-functions-view">
+  <title><structname>pg_stat_user_functions</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_user_functions</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_user_functions</structname> view will contain
+   one row for each tracked function, showing statistics about executions of
+   that function.  The <xref linkend="guc-track-functions"/> parameter
+   controls exactly which functions are tracked.
+  </para>
 
+  <table id="pg-stat-user-functions-view" xreflabel="pg_stat_user_functions">
+   <title><structname>pg_stat_user_functions</structname> View</title>
+   <tgroup cols="1">
+    <thead>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_autovacuum</structfield> <type>timestamp with time zone</type>
+       Column Type
       </para>
       <para>
-       Last time at which this table was vacuumed by the autovacuum
-       daemon
+       Description
       </para></entry>
      </row>
+    </thead>
 
+    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_analyze</structfield> <type>timestamp with time zone</type>
+       <structfield>funcid</structfield> <type>oid</type>
       </para>
       <para>
-       Last time at which this table was manually analyzed
+       OID of a function
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>last_autoanalyze</structfield> <type>timestamp with time zone</type>
+       <structfield>schemaname</structfield> <type>name</type>
       </para>
       <para>
-       Last time at which this table was analyzed by the autovacuum
-       daemon
+       Name of the schema this function is in
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>vacuum_count</structfield> <type>bigint</type>
+       <structfield>funcname</structfield> <type>name</type>
       </para>
       <para>
-       Number of times this table has been manually vacuumed
-       (not counting <command>VACUUM FULL</command>)
+       Name of this function
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>autovacuum_count</structfield> <type>bigint</type>
+       <structfield>calls</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of times this table has been vacuumed by the autovacuum
-       daemon
+       Number of times this function has been called
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>analyze_count</structfield> <type>bigint</type>
+       <structfield>total_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Number of times this table has been manually analyzed
+       Total time spent in this function and all other functions
+       called by it, in milliseconds
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>autoanalyze_count</structfield> <type>bigint</type>
+       <structfield>self_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Number of times this table has been analyzed by the autovacuum
-       daemon
+       Total time spent in this function itself, not including
+       other functions called by it, in milliseconds
       </para></entry>
      </row>
     </tbody>
@@ -4568,25 +4605,20 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-all-indexes-view">
-  <title><structname>pg_stat_all_indexes</structname></title>
+ <sect2 id="monitoring-pg-stat-wal-view">
+   <title><structname>pg_stat_wal</structname></title>
 
   <indexterm>
-   <primary>pg_stat_all_indexes</primary>
+   <primary>pg_stat_wal</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_all_indexes</structname> view will contain
-   one row for each index in the current database,
-   showing statistics about accesses to that specific index. The
-   <structname>pg_stat_user_indexes</structname> and
-   <structname>pg_stat_sys_indexes</structname> views
-   contain the same information,
-   but filtered to only show user and system indexes respectively.
+   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-all-indexes-view" xreflabel="pg_stat_all_indexes">
-   <title><structname>pg_stat_all_indexes</structname> View</title>
+  <table id="pg-stat-wal-view" xreflabel="pg_stat_wal">
+   <title><structname>pg_stat_wal</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -4602,130 +4634,126 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relid</structfield> <type>oid</type>
+       <structfield>wal_records</structfield> <type>bigint</type>
       </para>
       <para>
-       OID of the table for this index
+       Total number of WAL records generated
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>indexrelid</structfield> <type>oid</type>
+       <structfield>wal_fpi</structfield> <type>bigint</type>
       </para>
       <para>
-       OID of this index
+       Total number of WAL full page images generated
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>schemaname</structfield> <type>name</type>
+       <structfield>wal_bytes</structfield> <type>numeric</type>
       </para>
       <para>
-       Name of the schema this index is in
+       Total amount of WAL generated in bytes
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relname</structfield> <type>name</type>
+       <structfield>wal_buffers_full</structfield> <type>bigint</type>
       </para>
       <para>
-       Name of the table for this index
+       Number of times WAL data was written to disk because WAL buffers became full
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>indexrelname</structfield> <type>name</type>
+       <structfield>wal_write</structfield> <type>bigint</type>
       </para>
       <para>
-       Name of this index
+       Number of times WAL buffers were written out to disk via
+       <function>XLogWrite</function> request.
+       See <xref linkend="wal-configuration"/> for more information about
+       the internal WAL function <function>XLogWrite</function>.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_scan</structfield> <type>bigint</type>
+       <structfield>wal_sync</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of index scans initiated on this index
+       Number of times WAL files were synced to disk via
+       <function>issue_xlog_fsync</function> request
+       (if <xref linkend="guc-fsync"/> is <literal>on</literal> and
+       <xref linkend="guc-wal-sync-method"/> is either
+       <literal>fdatasync</literal>, <literal>fsync</literal> or
+       <literal>fsync_writethrough</literal>, otherwise zero).
+       See <xref linkend="wal-configuration"/> for more information about
+       the internal WAL function <function>issue_xlog_fsync</function>.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_tup_read</structfield> <type>bigint</type>
+       <structfield>wal_write_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Number of index entries returned by scans on this index
+       Total amount of time spent writing WAL buffers to disk via
+       <function>XLogWrite</function> request, in milliseconds
+       (if <xref linkend="guc-track-wal-io-timing"/> is enabled,
+       otherwise zero).  This includes the sync time when
+       <varname>wal_sync_method</varname> is either
+       <literal>open_datasync</literal> or <literal>open_sync</literal>.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_tup_fetch</structfield> <type>bigint</type>
+       <structfield>wal_sync_time</structfield> <type>double precision</type>
       </para>
       <para>
-       Number of live table rows fetched by simple index scans using this
-       index
+       Total amount of time spent syncing WAL files to disk via
+       <function>issue_xlog_fsync</function> request, in milliseconds
+       (if <varname>track_wal_io_timing</varname> is enabled,
+       <varname>fsync</varname> is <literal>on</literal>, and
+       <varname>wal_sync_method</varname> is either
+       <literal>fdatasync</literal>, <literal>fsync</literal> or
+       <literal>fsync_writethrough</literal>, otherwise zero).
       </para></entry>
      </row>
-    </tbody>
+
+     <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>
 
-  <para>
-   Indexes can be used by simple index scans, <quote>bitmap</quote> index scans,
-   and the optimizer.  In a bitmap scan
-   the output of several indexes can be combined via AND or OR rules,
-   so it is difficult to associate individual heap row fetches
-   with specific indexes when a bitmap scan is used.  Therefore, a bitmap
-   scan increments the
-   <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_read</structfield>
-   count(s) for the index(es) it uses, and it increments the
-   <structname>pg_stat_all_tables</structname>.<structfield>idx_tup_fetch</structfield>
-   count for the table, but it does not affect
-   <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_fetch</structfield>.
-   The optimizer also accesses indexes to check for supplied constants
-   whose values are outside the recorded range of the optimizer statistics
-   because the optimizer statistics might be stale.
-  </para>
-
-  <note>
-   <para>
-    The <structfield>idx_tup_read</structfield> and <structfield>idx_tup_fetch</structfield> counts
-    can be different even without any use of bitmap scans,
-    because <structfield>idx_tup_read</structfield> counts
-    index entries retrieved from the index while <structfield>idx_tup_fetch</structfield>
-    counts live rows fetched from the table.  The latter will be less if any
-    dead or not-yet-committed rows are fetched using the index, or if any
-    heap fetches are avoided by means of an index-only scan.
-   </para>
-  </note>
-
- </sect2>
+</sect2>
 
- <sect2 id="monitoring-pg-statio-all-tables-view">
-  <title><structname>pg_statio_all_tables</structname></title>
+ <sect2 id="monitoring-pg-stat-wal-receiver-view">
+  <title><structname>pg_stat_wal_receiver</structname></title>
 
   <indexterm>
-   <primary>pg_statio_all_tables</primary>
+   <primary>pg_stat_wal_receiver</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_statio_all_tables</structname> view will contain
-   one row for each table in the current database (including TOAST
-   tables), showing statistics about I/O on that specific table. The
-   <structname>pg_statio_user_tables</structname> and
-   <structname>pg_statio_sys_tables</structname> views
-   contain the same information,
-   but filtered to only show user and system tables respectively.
+   The <structname>pg_stat_wal_receiver</structname> view will contain only
+   one row, showing statistics about the WAL receiver from that receiver's
+   connected server.
   </para>
 
-  <table id="pg-statio-all-tables-view" xreflabel="pg_statio_all_tables">
-   <title><structname>pg_statio_all_tables</structname> View</title>
+  <table id="pg-stat-wal-receiver-view" xreflabel="pg_stat_wal_receiver">
+   <title><structname>pg_stat_wal_receiver</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -4741,100 +4769,148 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relid</structfield> <type>oid</type>
+       <structfield>pid</structfield> <type>integer</type>
       </para>
       <para>
-       OID of a table
+       Process ID of the WAL receiver process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>schemaname</structfield> <type>name</type>
+       <structfield>status</structfield> <type>text</type>
       </para>
       <para>
-       Name of the schema that this table is in
+       Activity status of the WAL receiver process
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>relname</structfield> <type>name</type>
+       <structfield>receive_start_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Name of this table
+       First write-ahead log location used when WAL receiver is
+       started
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>heap_blks_read</structfield> <type>bigint</type>
+       <structfield>receive_start_tli</structfield> <type>integer</type>
       </para>
       <para>
-       Number of disk blocks read from this table
+       First timeline number used when WAL receiver is started
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>heap_blks_hit</structfield> <type>bigint</type>
+       <structfield>written_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Number of buffer hits in this table
+       Last write-ahead log location already received and written to disk,
+       but not flushed. This should not be used for data integrity checks.
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_blks_read</structfield> <type>bigint</type>
+       <structfield>flushed_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Number of disk blocks read from all indexes on this table
+       Last write-ahead log location already received and flushed to
+       disk, the initial value of this field being the first log location used
+       when WAL receiver is started
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>idx_blks_hit</structfield> <type>bigint</type>
+       <structfield>received_tli</structfield> <type>integer</type>
       </para>
       <para>
-       Number of buffer hits in all indexes on this table
+       Timeline number of last write-ahead log location received and
+       flushed to disk, the initial value of this field being the timeline
+       number of the first log location used when WAL receiver is started
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>toast_blks_read</structfield> <type>bigint</type>
+       <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of disk blocks read from this table's TOAST table (if any)
+       Send time of last message received from origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>toast_blks_hit</structfield> <type>bigint</type>
+       <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of buffer hits in this table's TOAST table (if any)
+       Receipt time of last message received from origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tidx_blks_read</structfield> <type>bigint</type>
+       <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
       </para>
       <para>
-       Number of disk blocks read from this table's TOAST table indexes (if any)
+       Last write-ahead log location reported to origin WAL sender
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>tidx_blks_hit</structfield> <type>bigint</type>
+       <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
       </para>
       <para>
-       Number of buffer hits in this table's TOAST table indexes (if any)
+       Time of last write-ahead log location reported to origin WAL sender
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>slot_name</structfield> <type>text</type>
+      </para>
+      <para>
+       Replication slot name used by this WAL receiver
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>sender_host</structfield> <type>text</type>
+      </para>
+      <para>
+       Host of the <productname>PostgreSQL</productname> instance
+       this WAL receiver is connected to. This can be a host name,
+       an IP address, or a directory path if the connection is via
+       Unix socket.  (The path case can be distinguished because it
+       will always be an absolute path, beginning with <literal>/</literal>.)
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>sender_port</structfield> <type>integer</type>
+      </para>
+      <para>
+       Port number of the <productname>PostgreSQL</productname> instance
+       this WAL receiver is connected to.
+      </para></entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>conninfo</structfield> <type>text</type>
+      </para>
+      <para>
+       Connection string used by this WAL receiver,
+       with security-sensitive fields obfuscated.
       </para></entry>
      </row>
     </tbody>
@@ -5021,22 +5097,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-user-functions-view">
-  <title><structname>pg_stat_user_functions</structname></title>
+ <sect2 id="monitoring-pg-statio-all-tables-view">
+  <title><structname>pg_statio_all_tables</structname></title>
 
   <indexterm>
-   <primary>pg_stat_user_functions</primary>
+   <primary>pg_statio_all_tables</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_user_functions</structname> view will contain
-   one row for each tracked function, showing statistics about executions of
-   that function.  The <xref linkend="guc-track-functions"/> parameter
-   controls exactly which functions are tracked.
+   The <structname>pg_statio_all_tables</structname> view will contain
+   one row for each table in the current database (including TOAST
+   tables), showing statistics about I/O on that specific table. The
+   <structname>pg_statio_user_tables</structname> and
+   <structname>pg_statio_sys_tables</structname> views
+   contain the same information,
+   but filtered to only show user and system tables respectively.
   </para>
 
-  <table id="pg-stat-user-functions-view" xreflabel="pg_stat_user_functions">
-   <title><structname>pg_stat_user_functions</structname> View</title>
+  <table id="pg-statio-all-tables-view" xreflabel="pg_statio_all_tables">
+   <title><structname>pg_statio_all_tables</structname> View</title>
    <tgroup cols="1">
     <thead>
      <row>
@@ -5052,10 +5131,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>funcid</structfield> <type>oid</type>
+       <structfield>relid</structfield> <type>oid</type>
       </para>
       <para>
-       OID of a function
+       OID of a table
       </para></entry>
      </row>
 
@@ -5064,167 +5143,88 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        <structfield>schemaname</structfield> <type>name</type>
       </para>
       <para>
-       Name of the schema this function is in
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>funcname</structfield> <type>name</type>
-      </para>
-      <para>
-       Name of this function
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>calls</structfield> <type>bigint</type>
-      </para>
-      <para>
-       Number of times this function has been called
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>total_time</structfield> <type>double precision</type>
-      </para>
-      <para>
-       Total time spent in this function and all other functions
-       called by it, in milliseconds
-      </para></entry>
-     </row>
-
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>self_time</structfield> <type>double precision</type>
-      </para>
-      <para>
-       Total time spent in this function itself, not including
-       other functions called by it, in milliseconds
-      </para></entry>
-     </row>
-    </tbody>
-   </tgroup>
-  </table>
-
- </sect2>
-
- <sect2 id="monitoring-pg-stat-slru-view">
-  <title><structname>pg_stat_slru</structname></title>
-
-  <indexterm>
-   <primary>SLRU</primary>
-  </indexterm>
-
-  <indexterm>
-   <primary>pg_stat_slru</primary>
-  </indexterm>
-
-  <para>
-   <productname>PostgreSQL</productname> accesses certain on-disk information
-   via <firstterm>SLRU</firstterm> (simple least-recently-used) caches.
-   The <structname>pg_stat_slru</structname> view will contain
-   one row for each tracked SLRU cache, showing statistics about access
-   to cached pages.
-  </para>
-
-  <table id="pg-stat-slru-view" xreflabel="pg_stat_slru">
-   <title><structname>pg_stat_slru</structname> View</title>
-   <tgroup cols="1">
-    <thead>
-     <row>
-      <entry role="catalog_table_entry"><para role="column_definition">
-       Column Type
-      </para>
-      <para>
-       Description
+       Name of the schema that this table is in
       </para></entry>
      </row>
-    </thead>
 
-    <tbody>
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>name</structfield> <type>text</type>
+       <structfield>relname</structfield> <type>name</type>
       </para>
       <para>
-       Name of the SLRU
+       Name of this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_zeroed</structfield> <type>bigint</type>
+       <structfield>heap_blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of blocks zeroed during initializations
+       Number of disk blocks read from this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_hit</structfield> <type>bigint</type>
+       <structfield>heap_blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of times disk blocks were found already in the SLRU,
-       so that a read was not necessary (this only includes hits in the
-       SLRU, not the operating system's file system cache)
+       Number of buffer hits in this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_read</structfield> <type>bigint</type>
+       <structfield>idx_blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of disk blocks read for this SLRU
+       Number of disk blocks read from all indexes on this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_written</structfield> <type>bigint</type>
+       <structfield>idx_blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of disk blocks written for this SLRU
+       Number of buffer hits in all indexes on this table
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>blks_exists</structfield> <type>bigint</type>
+       <structfield>toast_blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of blocks checked for existence for this SLRU
+       Number of disk blocks read from this table's TOAST table (if any)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>flushes</structfield> <type>bigint</type>
+       <structfield>toast_blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of flushes of dirty data for this SLRU
+       Number of buffer hits in this table's TOAST table (if any)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>truncates</structfield> <type>bigint</type>
+       <structfield>tidx_blks_read</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of truncates for this SLRU
+       Number of disk blocks read from this table's TOAST table indexes (if any)
       </para></entry>
      </row>
 
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
-       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+       <structfield>tidx_blks_hit</structfield> <type>bigint</type>
       </para>
       <para>
-       Time at which these statistics were last reset
+       Number of buffer hits in this table's TOAST table indexes (if any)
       </para></entry>
      </row>
     </tbody>
-- 
1.8.3.1