[DOCS] Stats views and functions not in order?
Hi Hackers.
I noticed that there are quite a few items in Chapter 28.2 "The
Cumulative Statistics System" [1]https://www.postgresql.org/docs/devel/monitoring-stats.html which have no obvious order.
e.g.
- The views (28.2.3 -> 28.2.23) don't seem to be in any order that I
could work out. Why not alphabetical?
- [2]https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-VIEWS Table 2.1 "Dynamic Statistics View" views are not in alphabetical order?
- [2]https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-VIEWS Table 2.2 "Collected Statistics View" views are not in alphabetical order?
- [3]https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-FUNCTIONS Table 28.34 "Additional Statistics Functions" the
'pg_stat_clear_snapshot' is the only one not in order?
- [3]https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-FUNCTIONS Table 28.35 "Per-Backend Statistics Functions" the
'pg_stat_get_backend_idset' is the only one not in order?
~~
So it doesn't seem as readable as it could be. If other people think
the same, I can write a patch for it.
Thoughts?
------
[1]: https://www.postgresql.org/docs/devel/monitoring-stats.html
[2]: https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-VIEWS
[3]: https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-STATS-FUNCTIONS
Kind Regards,
Peter Smith.
Fujitsu Australia.
On Tue, Aug 2, 2022 at 9:40 AM Peter Smith <smithpb2250@gmail.com> wrote:
Hi Hackers.
I noticed that there are quite a few items in Chapter 28.2 "The
Cumulative Statistics System" [1] which have no obvious order.e.g.
- The views (28.2.3 -> 28.2.23) don't seem to be in any order that I
could work out. Why not alphabetical?- [2] Table 2.1 "Dynamic Statistics View" views are not in alphabetical order?
- [2] Table 2.2 "Collected Statistics View" views are not in alphabetical order?
- [3] Table 28.34 "Additional Statistics Functions" the
'pg_stat_clear_snapshot' is the only one not in order?- [3] Table 28.35 "Per-Backend Statistics Functions" the
'pg_stat_get_backend_idset' is the only one not in order?~~
So it doesn't seem as readable as it could be. If other people think
the same, I can write a patch for it.
I received no feedback when I reported this about a month ago, so I
went ahead and made patches to fix the problem anyway.
PSA. Note that no content was harmed in the making of these patches -
I only moved things around to be ordered.
IMO these docs look better now.
Thoughts?
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v1-0001-Fix-ordering-stats-views.patchapplication/octet-stream; name=v1-0001-Fix-ordering-stats-views.patchDownload
From d46db2591b1ffde40044a2a2b3a389f027f9f29c Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 30 Aug 2022 08:38:03 +1000
Subject: [PATCH v1] 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 1d9509a..2155863 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
v1-0002-Fix-ordering-tables-in-stats-docs.patchapplication/octet-stream; name=v1-0002-Fix-ordering-tables-in-stats-docs.patchDownload
From 3cb44648b04b7cf5672868e83b2dd8c43e1da212 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 30 Aug 2022 09:55:28 +1000
Subject: [PATCH v1] Fix ordering - tables in stats docs
Rearrange the rows of some stats docs tables to be alphabetically ordered.
Many of them were ordered already, but not all.
Modified tables are:
- Table 28.1 Dynamic Statistics View
- Table 28.2 Collected Statistics Views
- Table 28.12 Wait Events of type LWLock
- Table 28.34 Additional Statistic Functions
- Table 28.35 Per-Backend Statistics Functions
---
doc/src/sgml/monitoring.sgml | 444 +++++++++++++++++++++----------------------
1 file changed, 222 insertions(+), 222 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2155863..3561a23 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -316,63 +316,42 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
- <entry>One row per WAL sender process, showing statistics about
- replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
- <entry>Only one row, showing statistics about the WAL receiver from
- that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
- <entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
+ <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ GSSAPI authentication and encryption used on this connection.
+ See <link linkend="monitoring-pg-stat-gssapi-view">
+ <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
- <entry>At least one row per subscription, showing information about
- the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
+ <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>One row for each backend (including autovacuum worker processes) running
+ <command>ANALYZE</command>, showing current progress.
+ See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
+ <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>One row for each WAL sender process streaming a base backup,
+ showing current progress.
+ See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
+ <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>One row for each backend running
+ <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
+ See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
- <entry>One row for each backend (including autovacuum worker processes) running
- <command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
+ <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>One row for each backend running <command>COPY</command>, showing current progress.
+ See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
@@ -393,25 +372,46 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
- <entry>One row for each backend running
- <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
+ <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about blocks prefetched during recovery.
+ See <link linkend="monitoring-pg-stat-recovery-prefetch">
+ <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
- <entry>One row for each WAL sender process streaming a base backup,
- showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
+ <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>One row per WAL sender process, showing statistics about
+ replication to that sender's connected standby server.
+ See <link linkend="monitoring-pg-stat-replication-view">
+ <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
- <entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
+ <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ SSL used on this connection.
+ See <link linkend="monitoring-pg-stat-ssl-view">
+ <structname>pg_stat_ssl</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>At least one row per subscription, showing information about
+ the subscription workers.
+ See <link linkend="monitoring-pg-stat-subscription">
+ <structname>pg_stat_subscription</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about the WAL receiver from
+ that receiver's connected server.
+ See <link linkend="monitoring-pg-stat-wal-receiver-view">
+ <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
</tbody>
@@ -431,6 +431,26 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
+ <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ One row for each index in the current database, showing statistics
+ about accesses to that specific index.
+ See <link linkend="monitoring-pg-stat-all-indexes-view">
+ <structname>pg_stat_all_indexes</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about accesses to that specific table.
+ See <link linkend="monitoring-pg-stat-all-tables-view">
+ <structname>pg_stat_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
@@ -449,14 +469,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
- <entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
<entry>One row per database, showing database-wide statistics. See
<link linkend="monitoring-pg-stat-database-view">
@@ -475,89 +487,97 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
- system tables are shown.</entry>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
- tables are shown.</entry>
+ <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>One row per subscription, showing statistics about errors.
+ See <link linkend="monitoring-pg-stat-subscription-stats">
+ <structname>pg_stat_subscription_stats</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
- taken so far within the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_all_tables</structname> and related views).
- The columns for numbers of live and dead rows and vacuum and
- analyze actions are not present in this view.</entry>
+ <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
+ <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
<entry>
- One row for each index in the current database, showing statistics
- about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
+ One row for each tracked function, showing statistics
+ about executions of that function. See
+ <link linkend="monitoring-pg-stat-user-functions-view">
+ <structname>pg_stat_user_functions</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
+ <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
+ tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>One row only, showing statistics about WAL activity. See
+ <link linkend="monitoring-pg-stat-wal-view">
+ <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
+ taken so far within the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_all_tables</structname> and related views).
+ The columns for numbers of live and dead rows and vacuum and
+ analyze actions are not present in this view.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
+ calls during the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
@@ -572,18 +592,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
<entry>
One row for each sequence in the current database,
@@ -594,58 +602,50 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- system sequences are shown. (Presently, no system sequences are defined,
- so this view is always empty.)</entry>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- user sequences are shown.</entry>
+ <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
- <entry>
- One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ system sequences are shown. (Presently, no system sequences are defined,
+ so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
- calls during the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
- <entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
</row>
</tbody>
@@ -2072,6 +2072,18 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transaction during a parallel query.</entry>
</row>
<row>
+ <entry><literal>PgStatsDSA</literal></entry>
+ <entry>Waiting for stats dynamic shared memory allocator access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsHash</literal></entry>
+ <entry>Waiting for stats shared memory hash table access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsData</literal></entry>
+ <entry>Waiting for shared memory stats data access</entry>
+ </row>
+ <row>
<entry><literal>PredicateLockManager</literal></entry>
<entry>Waiting to access predicate lock information used by
serializable transactions.</entry>
@@ -2130,18 +2142,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transactions.</entry>
</row>
<row>
- <entry><literal>PgStatsDSA</literal></entry>
- <entry>Waiting for stats dynamic shared memory allocator access</entry>
- </row>
- <row>
- <entry><literal>PgStatsHash</literal></entry>
- <entry>Waiting for stats shared memory hash table access</entry>
- </row>
- <row>
- <entry><literal>PgStatsData</literal></entry>
- <entry>Waiting for shared memory stats data access</entry>
- </row>
- <row>
<entry><literal>SerializableXactHash</literal></entry>
<entry>Waiting to read or update information about serializable
transactions.</entry>
@@ -5285,6 +5285,19 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_clear_snapshot</primary>
+ </indexterm>
+ <function>pg_stat_clear_snapshot</function> ()
+ <returnvalue>void</returnvalue>
+ </para>
+ <para>
+ Discards the current statistics snapshot or cached information.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_activity</primary>
</indexterm>
<function>pg_stat_get_activity</function> ( <type>integer</type> )
@@ -5318,30 +5331,36 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_clear_snapshot</primary>
+ <primary>pg_stat_reset</primary>
</indexterm>
- <function>pg_stat_clear_snapshot</function> ()
+ <function>pg_stat_reset</function> ()
<returnvalue>void</returnvalue>
</para>
<para>
- Discards the current statistics snapshot or cached information.
+ Resets all statistics counters for the current database to zero.
+ </para>
+ <para>
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset</primary>
+ <primary>pg_stat_reset_replication_slot</primary>
</indexterm>
- <function>pg_stat_reset</function> ()
+ <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets all statistics counters for the current database to zero.
+ Resets statistics of the replication slot defined by the argument. If
+ the argument is <literal>NULL</literal>, resets statistics for all
+ the replication slots.
</para>
<para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
@@ -5374,14 +5393,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_table_counters</primary>
+ <primary>pg_stat_reset_single_function_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single table or index in the current database
- or shared across all databases in the cluster to zero.
+ Resets statistics for a single function in the current database to
+ zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5392,14 +5411,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_function_counters</primary>
+ <primary>pg_stat_reset_single_table_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single function in the current database to
- zero.
+ Resets statistics for a single table or index in the current database
+ or shared across all databases in the cluster to zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5441,25 +5460,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_replication_slot</primary>
- </indexterm>
- <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
- <returnvalue>void</returnvalue>
- </para>
- <para>
- Resets statistics of the replication slot defined by the argument. If
- the argument is <literal>NULL</literal>, resets statistics for all
- the replication slots.
- </para>
- <para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_reset_subscription_stats</primary>
</indexterm>
<function>pg_stat_reset_subscription_stats</function> ( <type>oid</type> )
@@ -5520,20 +5520,6 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_idset</primary>
- </indexterm>
- <function>pg_stat_get_backend_idset</function> ()
- <returnvalue>setof integer</returnvalue>
- </para>
- <para>
- Returns the set of currently active backend ID numbers (from 1 to the
- number of active backends).
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_get_backend_activity</primary>
</indexterm>
<function>pg_stat_get_backend_activity</function> ( <type>integer</type> )
@@ -5599,6 +5585,20 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_get_backend_idset</primary>
+ </indexterm>
+ <function>pg_stat_get_backend_idset</function> ()
+ <returnvalue>setof integer</returnvalue>
+ </para>
+ <para>
+ Returns the set of currently active backend ID numbers (from 1 to the
+ number of active backends).
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_backend_pid</primary>
</indexterm>
<function>pg_stat_get_backend_pid</function> ( <type>integer</type> )
@@ -5638,29 +5638,29 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event_type</primary>
+ <primary>pg_stat_get_backend_wait_event</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event type name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-table"/> for details.
+ Returns the wait event name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
+ <xref linkend="wait-event-timeout-table"/>.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event</primary>
+ <primary>pg_stat_get_backend_wait_event_type</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
- <xref linkend="wait-event-timeout-table"/>.
+ Returns the wait event type name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-table"/> for details.
</para></entry>
</row>
--
1.8.3.1
A rebase was needed.
PSA v2*.
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v2-0002-Fix-ordering-tables-in-stats-docs.patchapplication/octet-stream; name=v2-0002-Fix-ordering-tables-in-stats-docs.patchDownload
From 99ac15ac818a1afcc2215974672f4edc10e6ca7f Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 6 Oct 2022 15:54:04 +1100
Subject: [PATCH v2] Fix ordering - tables in stats docs.
Rearrange the rows of some stats docs tables to be alphabetically ordered.
Many of them were ordered already, but not all.
Modified tables are:
- Table 28.1 Dynamic Statistics View
- Table 28.2 Collected Statistics Views
- Table 28.12 Wait Events of type LWLock
- Table 28.34 Additional Statistic Functions
- Table 28.35 Per-Backend Statistics Functions
---
doc/src/sgml/monitoring.sgml | 442 +++++++++++++++++++++----------------------
1 file changed, 221 insertions(+), 221 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c223ca2..f94ff14 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -316,63 +316,42 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
- <entry>One row per WAL sender process, showing statistics about
- replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
- <entry>Only one row, showing statistics about the WAL receiver from
- that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
- <entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
+ <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ GSSAPI authentication and encryption used on this connection.
+ See <link linkend="monitoring-pg-stat-gssapi-view">
+ <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
- <entry>At least one row per subscription, showing information about
- the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
+ <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>One row for each backend (including autovacuum worker processes) running
+ <command>ANALYZE</command>, showing current progress.
+ See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
+ <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>One row for each WAL sender process streaming a base backup,
+ showing current progress.
+ See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
+ <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>One row for each backend running
+ <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
+ See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
- <entry>One row for each backend (including autovacuum worker processes) running
- <command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
+ <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>One row for each backend running <command>COPY</command>, showing current progress.
+ See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
@@ -393,25 +372,46 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
- <entry>One row for each backend running
- <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
+ <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about blocks prefetched during recovery.
+ See <link linkend="monitoring-pg-stat-recovery-prefetch">
+ <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
- <entry>One row for each WAL sender process streaming a base backup,
- showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
+ <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>One row per WAL sender process, showing statistics about
+ replication to that sender's connected standby server.
+ See <link linkend="monitoring-pg-stat-replication-view">
+ <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
- <entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
+ <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ SSL used on this connection.
+ See <link linkend="monitoring-pg-stat-ssl-view">
+ <structname>pg_stat_ssl</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>At least one row per subscription, showing information about
+ the subscription workers.
+ See <link linkend="monitoring-pg-stat-subscription">
+ <structname>pg_stat_subscription</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about the WAL receiver from
+ that receiver's connected server.
+ See <link linkend="monitoring-pg-stat-wal-receiver-view">
+ <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
</tbody>
@@ -431,6 +431,26 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
+ <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ One row for each index in the current database, showing statistics
+ about accesses to that specific index.
+ See <link linkend="monitoring-pg-stat-all-indexes-view">
+ <structname>pg_stat_all_indexes</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about accesses to that specific table.
+ See <link linkend="monitoring-pg-stat-all-tables-view">
+ <structname>pg_stat_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
@@ -449,14 +469,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
- <entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
<entry>One row per database, showing database-wide statistics. See
<link linkend="monitoring-pg-stat-database-view">
@@ -475,89 +487,97 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
- system tables are shown.</entry>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
- tables are shown.</entry>
+ <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>One row per subscription, showing statistics about errors.
+ See <link linkend="monitoring-pg-stat-subscription-stats">
+ <structname>pg_stat_subscription_stats</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
- taken so far within the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_all_tables</structname> and related views).
- The columns for numbers of live and dead rows and vacuum and
- analyze actions are not present in this view.</entry>
+ <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
+ <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
<entry>
- One row for each index in the current database, showing statistics
- about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
+ One row for each tracked function, showing statistics
+ about executions of that function. See
+ <link linkend="monitoring-pg-stat-user-functions-view">
+ <structname>pg_stat_user_functions</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
+ <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
+ tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>One row only, showing statistics about WAL activity. See
+ <link linkend="monitoring-pg-stat-wal-view">
+ <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
+ taken so far within the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_all_tables</structname> and related views).
+ The columns for numbers of live and dead rows and vacuum and
+ analyze actions are not present in this view.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
+ calls during the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
@@ -572,18 +592,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
<entry>
One row for each sequence in the current database,
@@ -594,58 +602,50 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- system sequences are shown. (Presently, no system sequences are defined,
- so this view is always empty.)</entry>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- user sequences are shown.</entry>
+ <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
- <entry>
- One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ system sequences are shown. (Presently, no system sequences are defined,
+ so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
- calls during the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
- <entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
</row>
</tbody>
@@ -2072,6 +2072,18 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transaction during a parallel query.</entry>
</row>
<row>
+ <entry><literal>PgStatsDSA</literal></entry>
+ <entry>Waiting for stats dynamic shared memory allocator access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsHash</literal></entry>
+ <entry>Waiting for stats shared memory hash table access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsData</literal></entry>
+ <entry>Waiting for shared memory stats data access</entry>
+ </row>
+ <row>
<entry><literal>PredicateLockManager</literal></entry>
<entry>Waiting to access predicate lock information used by
serializable transactions.</entry>
@@ -2130,18 +2142,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transactions.</entry>
</row>
<row>
- <entry><literal>PgStatsDSA</literal></entry>
- <entry>Waiting for stats dynamic shared memory allocator access</entry>
- </row>
- <row>
- <entry><literal>PgStatsHash</literal></entry>
- <entry>Waiting for stats shared memory hash table access</entry>
- </row>
- <row>
- <entry><literal>PgStatsData</literal></entry>
- <entry>Waiting for shared memory stats data access</entry>
- </row>
- <row>
<entry><literal>SerializableXactHash</literal></entry>
<entry>Waiting to read or update information about serializable
transactions.</entry>
@@ -5285,6 +5285,19 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_clear_snapshot</primary>
+ </indexterm>
+ <function>pg_stat_clear_snapshot</function> ()
+ <returnvalue>void</returnvalue>
+ </para>
+ <para>
+ Discards the current statistics snapshot or cached information.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_activity</primary>
</indexterm>
<function>pg_stat_get_activity</function> ( <type>integer</type> )
@@ -5318,30 +5331,36 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_clear_snapshot</primary>
+ <primary>pg_stat_reset</primary>
</indexterm>
- <function>pg_stat_clear_snapshot</function> ()
+ <function>pg_stat_reset</function> ()
<returnvalue>void</returnvalue>
</para>
<para>
- Discards the current statistics snapshot or cached information.
+ Resets all statistics counters for the current database to zero.
+ </para>
+ <para>
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset</primary>
+ <primary>pg_stat_reset_replication_slot</primary>
</indexterm>
- <function>pg_stat_reset</function> ()
+ <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets all statistics counters for the current database to zero.
+ Resets statistics of the replication slot defined by the argument. If
+ the argument is <literal>NULL</literal>, resets statistics for all
+ the replication slots.
</para>
<para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
@@ -5374,14 +5393,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_table_counters</primary>
+ <primary>pg_stat_reset_single_function_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single table or index in the current database
- or shared across all databases in the cluster to zero.
+ Resets statistics for a single function in the current database to
+ zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5392,14 +5411,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_function_counters</primary>
+ <primary>pg_stat_reset_single_table_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single function in the current database to
- zero.
+ Resets statistics for a single table or index in the current database
+ or shared across all databases in the cluster to zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5441,25 +5460,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_replication_slot</primary>
- </indexterm>
- <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
- <returnvalue>void</returnvalue>
- </para>
- <para>
- Resets statistics of the replication slot defined by the argument. If
- the argument is <literal>NULL</literal>, resets statistics for all
- the replication slots.
- </para>
- <para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_reset_subscription_stats</primary>
</indexterm>
<function>pg_stat_reset_subscription_stats</function> ( <type>oid</type> )
@@ -5523,19 +5523,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_idset</primary>
- </indexterm>
- <function>pg_stat_get_backend_idset</function> ()
- <returnvalue>setof integer</returnvalue>
- </para>
- <para>
- Returns the set of currently active backend ID numbers.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_get_backend_activity</primary>
</indexterm>
<function>pg_stat_get_backend_activity</function> ( <type>integer</type> )
@@ -5598,6 +5585,19 @@ FROM pg_stat_get_backend_idset() AS backendid;
</para></entry>
</row>
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>pg_stat_get_backend_idset</primary>
+ </indexterm>
+ <function>pg_stat_get_backend_idset</function> ()
+ <returnvalue>setof integer</returnvalue>
+ </para>
+ <para>
+ Returns the set of currently active backend ID numbers.
+ </para></entry>
+ </row>
+
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
@@ -5640,29 +5640,29 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event_type</primary>
+ <primary>pg_stat_get_backend_wait_event</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event type name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-table"/> for details.
+ Returns the wait event name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
+ <xref linkend="wait-event-timeout-table"/>.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event</primary>
+ <primary>pg_stat_get_backend_wait_event_type</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
- <xref linkend="wait-event-timeout-table"/>.
+ Returns the wait event type name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-table"/> for details.
</para></entry>
</row>
--
1.8.3.1
v2-0001-Fix-ordering-stats-views.patchapplication/octet-stream; name=v2-0001-Fix-ordering-stats-views.patchDownload
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
A rebase was needed.
PSA v3*.
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Sorry, I forgot the attachments in the previous post. PSA.
Show quoted text
On Mon, Oct 24, 2022 at 12:51 PM Peter Smith <smithpb2250@gmail.com> wrote:
A rebase was needed.
PSA v3*.
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v3-0002-Fix-ordering-tables-in-stats-docs.patchapplication/octet-stream; name=v3-0002-Fix-ordering-tables-in-stats-docs.patchDownload
From f58e2bfed48de79761583f2191e9e3d6d9c4a0e9 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 24 Oct 2022 12:41:41 +1100
Subject: [PATCH v3] Fix ordering - tables in stats docs.
Rearrange the rows of some stats docs tables to be alphabetically ordered.
Many of them were ordered already, but not all.
Modified tables are:
- Table 28.1 Dynamic Statistics View
- Table 28.2 Collected Statistics Views
- Table 28.12 Wait Events of type LWLock
- Table 28.34 Additional Statistic Functions
- Table 28.35 Per-Backend Statistics Functions
---
doc/src/sgml/monitoring.sgml | 442 +++++++++++++++++++++----------------------
1 file changed, 221 insertions(+), 221 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 4733a28..5ef8492 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -316,63 +316,42 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
- <entry>One row per WAL sender process, showing statistics about
- replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
- <entry>Only one row, showing statistics about the WAL receiver from
- that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
- <entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
+ <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ GSSAPI authentication and encryption used on this connection.
+ See <link linkend="monitoring-pg-stat-gssapi-view">
+ <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
- <entry>At least one row per subscription, showing information about
- the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
+ <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>One row for each backend (including autovacuum worker processes) running
+ <command>ANALYZE</command>, showing current progress.
+ See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
+ <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>One row for each WAL sender process streaming a base backup,
+ showing current progress.
+ See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
- <entry>One row per connection (regular and replication), showing information about
- GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
+ <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>One row for each backend running
+ <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
+ See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
- <entry>One row for each backend (including autovacuum worker processes) running
- <command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
+ <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>One row for each backend running <command>COPY</command>, showing current progress.
+ See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
@@ -393,25 +372,46 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
- <entry>One row for each backend running
- <command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
+ <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about blocks prefetched during recovery.
+ See <link linkend="monitoring-pg-stat-recovery-prefetch">
+ <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
- <entry>One row for each WAL sender process streaming a base backup,
- showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
+ <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>One row per WAL sender process, showing statistics about
+ replication to that sender's connected standby server.
+ See <link linkend="monitoring-pg-stat-replication-view">
+ <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
- <entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
+ <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>One row per connection (regular and replication), showing information about
+ SSL used on this connection.
+ See <link linkend="monitoring-pg-stat-ssl-view">
+ <structname>pg_stat_ssl</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>At least one row per subscription, showing information about
+ the subscription workers.
+ See <link linkend="monitoring-pg-stat-subscription">
+ <structname>pg_stat_subscription</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>Only one row, showing statistics about the WAL receiver from
+ that receiver's connected server.
+ See <link linkend="monitoring-pg-stat-wal-receiver-view">
+ <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
</tbody>
@@ -431,6 +431,26 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
+ <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ One row for each index in the current database, showing statistics
+ about accesses to that specific index.
+ See <link linkend="monitoring-pg-stat-all-indexes-view">
+ <structname>pg_stat_all_indexes</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about accesses to that specific table.
+ See <link linkend="monitoring-pg-stat-all-tables-view">
+ <structname>pg_stat_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
@@ -449,14 +469,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
- <entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
<entry>One row per database, showing database-wide statistics. See
<link linkend="monitoring-pg-stat-database-view">
@@ -475,89 +487,97 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
- system tables are shown.</entry>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
- tables are shown.</entry>
+ <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>One row per subscription, showing statistics about errors.
+ See <link linkend="monitoring-pg-stat-subscription-stats">
+ <structname>pg_stat_subscription_stats</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
- taken so far within the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_all_tables</structname> and related views).
- The columns for numbers of live and dead rows and vacuum and
- analyze actions are not present in this view.</entry>
+ <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
+ <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
<entry>
- One row for each index in the current database, showing statistics
- about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
+ One row for each tracked function, showing statistics
+ about executions of that function. See
+ <link linkend="monitoring-pg-stat-user-functions-view">
+ <structname>pg_stat_user_functions</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
+ <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
+ tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
+ <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>One row only, showing statistics about WAL activity. See
+ <link linkend="monitoring-pg-stat-wal-view">
+ <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
+ taken so far within the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_all_tables</structname> and related views).
+ The columns for numbers of live and dead rows and vacuum and
+ analyze actions are not present in this view.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
+ calls during the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
@@ -572,18 +592,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
- indexes on user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
<entry>
One row for each sequence in the current database,
@@ -594,58 +602,50 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- system sequences are shown. (Presently, no system sequences are defined,
- so this view is always empty.)</entry>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
- user sequences are shown.</entry>
+ <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
- <entry>
- One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ system sequences are shown. (Presently, no system sequences are defined,
+ so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
- calls during the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
+ indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
+ user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
- <entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
- </entry>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
</row>
</tbody>
@@ -2072,6 +2072,18 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transaction during a parallel query.</entry>
</row>
<row>
+ <entry><literal>PgStatsDSA</literal></entry>
+ <entry>Waiting for stats dynamic shared memory allocator access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsHash</literal></entry>
+ <entry>Waiting for stats shared memory hash table access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsData</literal></entry>
+ <entry>Waiting for shared memory stats data access</entry>
+ </row>
+ <row>
<entry><literal>PredicateLockManager</literal></entry>
<entry>Waiting to access predicate lock information used by
serializable transactions.</entry>
@@ -2130,18 +2142,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transactions.</entry>
</row>
<row>
- <entry><literal>PgStatsDSA</literal></entry>
- <entry>Waiting for stats dynamic shared memory allocator access</entry>
- </row>
- <row>
- <entry><literal>PgStatsHash</literal></entry>
- <entry>Waiting for stats shared memory hash table access</entry>
- </row>
- <row>
- <entry><literal>PgStatsData</literal></entry>
- <entry>Waiting for shared memory stats data access</entry>
- </row>
- <row>
<entry><literal>SerializableXactHash</literal></entry>
<entry>Waiting to read or update information about serializable
transactions.</entry>
@@ -5315,6 +5315,19 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_clear_snapshot</primary>
+ </indexterm>
+ <function>pg_stat_clear_snapshot</function> ()
+ <returnvalue>void</returnvalue>
+ </para>
+ <para>
+ Discards the current statistics snapshot or cached information.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_activity</primary>
</indexterm>
<function>pg_stat_get_activity</function> ( <type>integer</type> )
@@ -5348,30 +5361,36 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_clear_snapshot</primary>
+ <primary>pg_stat_reset</primary>
</indexterm>
- <function>pg_stat_clear_snapshot</function> ()
+ <function>pg_stat_reset</function> ()
<returnvalue>void</returnvalue>
</para>
<para>
- Discards the current statistics snapshot or cached information.
+ Resets all statistics counters for the current database to zero.
+ </para>
+ <para>
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset</primary>
+ <primary>pg_stat_reset_replication_slot</primary>
</indexterm>
- <function>pg_stat_reset</function> ()
+ <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets all statistics counters for the current database to zero.
+ Resets statistics of the replication slot defined by the argument. If
+ the argument is <literal>NULL</literal>, resets statistics for all
+ the replication slots.
</para>
<para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
+ This function is restricted to superusers by default, but other users
+ can be granted EXECUTE to run the function.
</para></entry>
</row>
@@ -5404,14 +5423,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_table_counters</primary>
+ <primary>pg_stat_reset_single_function_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single table or index in the current database
- or shared across all databases in the cluster to zero.
+ Resets statistics for a single function in the current database to
+ zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5422,14 +5441,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_single_function_counters</primary>
+ <primary>pg_stat_reset_single_table_counters</primary>
</indexterm>
- <function>pg_stat_reset_single_function_counters</function> ( <type>oid</type> )
+ <function>pg_stat_reset_single_table_counters</function> ( <type>oid</type> )
<returnvalue>void</returnvalue>
</para>
<para>
- Resets statistics for a single function in the current database to
- zero.
+ Resets statistics for a single table or index in the current database
+ or shared across all databases in the cluster to zero.
</para>
<para>
This function is restricted to superusers by default, but other users
@@ -5471,25 +5490,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_reset_replication_slot</primary>
- </indexterm>
- <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
- <returnvalue>void</returnvalue>
- </para>
- <para>
- Resets statistics of the replication slot defined by the argument. If
- the argument is <literal>NULL</literal>, resets statistics for all
- the replication slots.
- </para>
- <para>
- This function is restricted to superusers by default, but other users
- can be granted EXECUTE to run the function.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_reset_subscription_stats</primary>
</indexterm>
<function>pg_stat_reset_subscription_stats</function> ( <type>oid</type> )
@@ -5564,19 +5564,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_idset</primary>
- </indexterm>
- <function>pg_stat_get_backend_idset</function> ()
- <returnvalue>setof integer</returnvalue>
- </para>
- <para>
- Returns the set of currently active backend ID numbers.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_get_backend_activity</primary>
</indexterm>
<function>pg_stat_get_backend_activity</function> ( <type>integer</type> )
@@ -5600,6 +5587,19 @@ FROM pg_stat_get_backend_idset() AS backendid;
</para></entry>
</row>
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>pg_stat_get_backend_idset</primary>
+ </indexterm>
+ <function>pg_stat_get_backend_idset</function> ()
+ <returnvalue>setof integer</returnvalue>
+ </para>
+ <para>
+ Returns the set of currently active backend ID numbers.
+ </para></entry>
+ </row>
+
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
@@ -5681,29 +5681,29 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event_type</primary>
+ <primary>pg_stat_get_backend_wait_event</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event type name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-table"/> for details.
+ Returns the wait event name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
+ <xref linkend="wait-event-timeout-table"/>.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event</primary>
+ <primary>pg_stat_get_backend_wait_event_type</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
- <xref linkend="wait-event-timeout-table"/>.
+ Returns the wait event type name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-table"/> for details.
</para></entry>
</row>
--
1.8.3.1
v3-0001-Fix-ordering-stats-views.patchapplication/octet-stream; name=v3-0001-Fix-ordering-stats-views.patchDownload
From 7fc2753e49a1473c1afd3a2a6fcb60f8019d08a6 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 24 Oct 2022 12:32:26 +1100
Subject: [PATCH v3] Fix ordering - stats views
Rearrange the stats view sections to be alphabetically ordered.
BEFORE
28.2.3. pg_stat_activity
28.2.4. pg_stat_replication
28.2.5. pg_stat_replication_slots
28.2.6. pg_stat_wal_receiver
28.2.7. pg_stat_recovery_prefetch
28.2.8. pg_stat_subscription
28.2.9. pg_stat_subscription_stats
28.2.10. pg_stat_ssl
28.2.11. pg_stat_gssapi
28.2.12. pg_stat_archiver
28.2.13. pg_stat_bgwriter
28.2.14. pg_stat_wal
28.2.15. pg_stat_database
28.2.16. pg_stat_database_conflicts
28.2.17. pg_stat_all_tables
28.2.18. pg_stat_all_indexes
28.2.19. pg_statio_all_tables
28.2.20. pg_statio_all_indexes
28.2.21. pg_statio_all_sequences
28.2.22. pg_stat_user_functions
28.2.23. pg_stat_slru
AFTER
28.2.3. pg_stat_activity
28.2.4. pg_stat_all_indexes
28.2.5. pg_stat_all_tables
28.2.6. pg_stat_archiver
28.2.7. pg_stat_bgwriter
28.2.8. pg_stat_database
28.2.9. pg_stat_database_conflicts
28.2.10. pg_stat_gssapi
28.2.11. pg_stat_recovery_prefetch
28.2.12. pg_stat_replication
28.2.13. pg_stat_replication_slots
28.2.14. pg_stat_slru
28.2.15. pg_stat_ssl
28.2.16. pg_stat_subscription
28.2.17. pg_stat_subscription_stats
28.2.18. pg_stat_user_functions
28.2.19. pg_stat_wal
28.2.20. pg_stat_wal_receiver
28.2.21. pg_statio_all_tables
28.2.22. pg_statio_all_indexes
28.2.23. pg_statio_all_sequences
---
doc/src/sgml/monitoring.sgml | 2442 +++++++++++++++++++++---------------------
1 file changed, 1221 insertions(+), 1221 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index e5d622d..4733a28 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,385 @@ 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>last_idx_scan</structfield> <type>timestamptz</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
+ The time of the last scan on this index, based on the
+ most recent transaction stop time
</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_read</structfield> <type>bigint</type>
</para>
<para>
- Time when this process was started, i.e., when the
- client connected to this WAL sender
+ 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_xmin</structfield> <type>xid</type>
+ <structfield>idx_tup_fetch</structfield> <type>bigint</type>
</para>
<para>
- This standby's <literal>xmin</literal> horizon reported
- by <xref linkend="guc-hot-standby-feedback"/>.
+ 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>state</structfield> <type>text</type>
+ Column 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>
+ Description
</para></entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sent_lsn</structfield> <type>pg_lsn</type>
+ <structfield>relid</structfield> <type>oid</type>
</para>
<para>
- Last write-ahead log location sent on this connection
+ OID of a table
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>write_lsn</structfield> <type>pg_lsn</type>
+ <structfield>schemaname</structfield> <type>name</type>
</para>
<para>
- Last write-ahead log location written to disk by this standby
- server
+ Name of the schema that this table is in
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>flush_lsn</structfield> <type>pg_lsn</type>
+ <structfield>relname</structfield> <type>name</type>
</para>
<para>
- Last write-ahead log location flushed to disk by this standby
- server
+ Name of 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_scan</structfield> <type>bigint</type>
</para>
<para>
- Last write-ahead log location replayed into the database on 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>write_lag</structfield> <type>interval</type>
+ <structfield>last_seq_scan</structfield> <type>timestamptz</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.
+ The time of the last sequential scan on this table, based on the
+ most recent transaction stop time
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>flush_lag</structfield> <type>interval</type>
+ <structfield>seq_tup_read</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 sequential scans
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>replay_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, 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 index scans initiated on this table
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sync_priority</structfield> <type>integer</type>
+ <structfield>last_idx_scan</structfield> <type>timestamptz</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.
+ The time of the last index scan on this table, based on the
+ most recent transaction stop time
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sync_state</structfield> <type>text</type>
+ <structfield>idx_tup_fetch</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 live rows fetched by index scans
</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_ins</structfield> <type>bigint</type>
</para>
<para>
- Send time of last reply message received from standby server
+ Number of rows inserted
</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>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>n_tup_upd</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of rows updated (includes <link linkend="storage-hot">HOT updated rows</link>)
+ </para></entry>
+ </row>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
- <title><structname>pg_stat_replication_slots</structname></title>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>n_tup_del</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of rows deleted
+ </para></entry>
+ </row>
- <indexterm>
- <primary>pg_stat_replication_slots</primary>
- </indexterm>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>n_tup_hot_upd</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of rows HOT updated (i.e., with no separate index
+ update required)
+ </para></entry>
+ </row>
- <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 +2737,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,148 +2766,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>pid</structfield> <type>integer</type>
+ <structfield>archived_count</structfield> <type>bigint</type>
</para>
<para>
- Process ID 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>status</structfield> <type>text</type>
+ <structfield>last_archived_wal</structfield> <type>text</type>
</para>
<para>
- Activity status of the WAL receiver process
+ 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_lsn</structfield> <type>pg_lsn</type>
+ <structfield>last_archived_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- First write-ahead log location 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>receive_start_tli</structfield> <type>integer</type>
+ <structfield>failed_count</structfield> <type>bigint</type>
</para>
<para>
- First timeline number used when WAL receiver is started
+ Number of failed attempts for archiving WAL files
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>written_lsn</structfield> <type>pg_lsn</type>
+ <structfield>last_failed_wal</structfield> <type>text</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.
+ 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>flushed_lsn</structfield> <type>pg_lsn</type>
+ <structfield>last_failed_time</structfield> <type>timestamp with time zone</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
+ Time 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>stats_reset</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 at which these statistics were last reset
</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>
+
+ <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>last_msg_send_time</structfield> <type>timestamp with time zone</type>
+ Column Type
</para>
<para>
- Send time of last message received from origin WAL sender
+ Description
</para></entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
+ <structfield>checkpoints_timed</structfield> <type>bigint</type>
</para>
<para>
- Receipt time of last message received from 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>latest_end_lsn</structfield> <type>pg_lsn</type>
+ <structfield>checkpoints_req</structfield> <type>bigint</type>
</para>
<para>
- Last write-ahead log location reported to origin WAL sender
+ Number of requested checkpoints that have been performed
</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>checkpoint_write_time</structfield> <type>double precision</type>
</para>
<para>
- Time of last write-ahead log location reported to origin WAL sender
+ 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>slot_name</structfield> <type>text</type>
+ <structfield>checkpoint_sync_time</structfield> <type>double precision</type>
</para>
<para>
- Replication slot name used by this WAL receiver
+ 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>sender_host</structfield> <type>text</type>
+ <structfield>buffers_checkpoint</structfield> <type>bigint</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>.)
+ Number of buffers written during checkpoints
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sender_port</structfield> <type>integer</type>
+ <structfield>buffers_clean</structfield> <type>bigint</type>
</para>
<para>
- Port number of the <productname>PostgreSQL</productname> instance
- this WAL receiver is connected to.
+ Number of buffers written by the background writer
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>conninfo</structfield> <type>text</type>
+ <structfield>maxwritten_clean</structfield> <type>bigint</type>
</para>
<para>
- Connection string used by this WAL receiver,
- with security-sensitive fields obfuscated.
+ 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>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>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>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>stats_reset</structfield> <type>timestamp with time zone</type>
+ </para>
+ <para>
+ Time at which these statistics were last reset
</para></entry>
</row>
</tbody>
@@ -2983,24 +2978,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</sect2>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
- <title><structname>pg_stat_recovery_prefetch</structname></title>
+ <sect2 id="monitoring-pg-stat-database-view">
+ <title><structname>pg_stat_database</structname></title>
<indexterm>
- <primary>pg_stat_recovery_prefetch</primary>
+ <primary>pg_stat_database</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.
+ 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-recovery-prefetch-view" xreflabel="pg_stat_recovery_prefetch">
- <title><structname>pg_stat_recovery_prefetch</structname> View</title>
+ <table id="pg-stat-database-view" xreflabel="pg_stat_database">
+ <title><structname>pg_stat_database</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -3015,292 +3007,285 @@ 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>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>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>prefetch</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks prefetched because they were not in the buffer pool
- </para>
- </entry>
+ <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>hit</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks not prefetched because they were already in the buffer pool
- </para>
- </entry>
+ <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>skip_init</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks not prefetched because they would be zero-initialized
- </para>
- </entry>
+ <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>skip_new</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks not prefetched because they didn't exist yet
- </para>
- </entry>
+ <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>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>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>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>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>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>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>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>tup_fetched</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of live rows fetched by index scans in this database
+ </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>tup_inserted</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of rows inserted by queries in this database
+ </para></entry>
</row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
- <sect2 id="monitoring-pg-stat-subscription">
- <title><structname>pg_stat_subscription</structname></title>
-
- <indexterm>
- <primary>pg_stat_subscription</primary>
- </indexterm>
-
- <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
- <title><structname>pg_stat_subscription</structname> View</title>
- <tgroup cols="1">
- <thead>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- Column Type
+ <structfield>tup_updated</structfield> <type>bigint</type>
</para>
<para>
- Description
+ Number of rows updated 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_deleted</structfield> <type>bigint</type>
</para>
<para>
- OID 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>subname</structfield> <type>name</type>
+ <structfield>conflicts</structfield> <type>bigint</type>
</para>
<para>
- Name of the subscription
+ 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>pid</structfield> <type>integer</type>
+ <structfield>temp_files</structfield> <type>bigint</type>
</para>
<para>
- Process ID of the subscription worker process
+ 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>relid</structfield> <type>oid</type>
+ <structfield>temp_bytes</structfield> <type>bigint</type>
</para>
<para>
- OID of the relation that the worker is synchronizing; null for the
- main apply worker
+ 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>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>received_lsn</structfield> <type>pg_lsn</type>
+ <structfield>deadlocks</structfield> <type>bigint</type>
</para>
<para>
- Last write-ahead log location received, the initial value of
- this field being 0
+ Number of deadlocks detected in this database
</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>checksum_failures</structfield> <type>bigint</type>
</para>
<para>
- Send time of last message received from origin WAL sender
+ 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>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
+ <structfield>checksum_last_failure</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Receipt time of last message received from origin WAL sender
+ 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>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
+ <structfield>blk_read_time</structfield> <type>double precision</type>
</para>
<para>
- Last write-ahead log location reported to origin WAL sender
+ 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>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
+ <structfield>blk_write_time</structfield> <type>double precision</type>
</para>
<para>
- Time of last write-ahead log location reported to origin WAL
- sender
+ 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>
- </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>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>session_time</structfield> <type>double precision</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)
+ </para></entry>
+ </row>
- <para>
- The <structname>pg_stat_subscription_stats</structname> view will contain
- one row per subscription.
- </para>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>active_time</structfield> <type>double precision</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>)
+ </para></entry>
+ </row>
- <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>idle_in_transaction_time</structfield> <type>double precision</type>
</para>
<para>
- Description
+ 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>
- </thead>
- <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>subid</structfield> <type>oid</type>
+ <structfield>sessions</structfield> <type>bigint</type>
</para>
<para>
- OID of the subscription
+ Total number of sessions established to this database
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>subname</structfield> <type>name</type>
+ <structfield>sessions_abandoned</structfield> <type>bigint</type>
</para>
<para>
- Name of the subscription
+ 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>apply_error_count</structfield> <type>bigint</type>
+ <structfield>sessions_fatal</structfield> <type>bigint</type>
</para>
<para>
- Number of times an error occurred while applying changes
+ 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>sync_error_count</structfield> <type>bigint</type>
+ <structfield>sessions_killed</structfield> <type>bigint</type>
</para>
<para>
- Number of times an error occurred during the initial table
- synchronization
+ Number of database sessions to this database that were terminated
+ by operator intervention
</para></entry>
</row>
@@ -3318,24 +3303,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</sect2>
- <sect2 id="monitoring-pg-stat-ssl-view">
- <title><structname>pg_stat_ssl</structname></title>
+ <sect2 id="monitoring-pg-stat-database-conflicts-view">
+ <title><structname>pg_stat_database_conflicts</structname></title>
<indexterm>
- <primary>pg_stat_ssl</primary>
+ <primary>pg_stat_database_conflicts</primary>
</indexterm>
<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.
+ 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-ssl-view" xreflabel="pg_stat_ssl">
- <title><structname>pg_stat_ssl</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>
@@ -3351,86 +3335,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>
- </para>
- <para>
- Process ID of a backend or WAL sender process
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>ssl</structfield> <type>boolean</type>
+ <structfield>datid</structfield> <type>oid</type>
</para>
<para>
- True if SSL is used on this connection
+ OID of a database
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>version</structfield> <type>text</type>
+ <structfield>datname</structfield> <type>name</type>
</para>
<para>
- Version of SSL in use, or NULL if SSL is not in use
- on this connection
+ Name of this database
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>cipher</structfield> <type>text</type>
+ <structfield>confl_tablespace</structfield> <type>bigint</type>
</para>
<para>
- Name of SSL cipher in use, or NULL if SSL is not in use
- on this connection
+ 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>bits</structfield> <type>integer</type>
+ <structfield>confl_lock</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 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>client_dn</structfield> <type>text</type>
+ <structfield>confl_snapshot</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 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>client_serial</structfield> <type>numeric</type>
+ <structfield>confl_bufferpin</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 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>issuer_dn</structfield> <type>text</type>
+ <structfield>confl_deadlock</structfield> <type>bigint</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>.
+ Number of queries in this database that have been canceled due to
+ deadlocks
</para></entry>
</row>
</tbody>
@@ -3514,20 +3481,168 @@ 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-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
+ </para>
+ <para>
+ Description
+ </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>
+ </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>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-replication-view">
+ <title><structname>pg_stat_replication</structname></title>
<indexterm>
- <primary>pg_stat_archiver</primary>
+ <primary>pg_stat_replication</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.
+ <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-archiver-view" xreflabel="pg_stat_archiver">
- <title><structname>pg_stat_archiver</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>
@@ -3543,240 +3658,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>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 WAL sender process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_archived_wal</structfield> <type>text</type>
+ <structfield>usesysid</structfield> <type>oid</type>
</para>
<para>
- Name of the WAL file most recently successfully archived
+ OID of the user logged into this WAL sender process
</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>usename</structfield> <type>name</type>
</para>
<para>
- Time of the most recent successful archive operation
+ Name of the user logged into this WAL sender process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>failed_count</structfield> <type>bigint</type>
+ <structfield>application_name</structfield> <type>text</type>
</para>
<para>
- Number of failed attempts for archiving WAL files
+ 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>last_failed_wal</structfield> <type>text</type>
+ <structfield>client_addr</structfield> <type>inet</type>
</para>
<para>
- Name of the WAL file of the most recent failed archival operation
+ 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>last_failed_time</structfield> <type>timestamp with time zone</type>
+ <structfield>client_hostname</structfield> <type>text</type>
</para>
<para>
- Time of the most recent failed archival operation
+ 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>stats_reset</structfield> <type>timestamp with time zone</type>
+ <structfield>client_port</structfield> <type>integer</type>
</para>
<para>
- Time at which these statistics were last reset
+ 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>
- </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>
-
- <indexterm>
- <primary>pg_stat_bgwriter</primary>
- </indexterm>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>backend_start</structfield> <type>timestamp with time zone</type>
+ </para>
+ <para>
+ Time when this process was started, i.e., when the
+ client connected to this WAL sender
+ </para></entry>
+ </row>
- <para>
- The <structname>pg_stat_bgwriter</structname> view will always have a
- single row, containing global data for the cluster.
- </para>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>backend_xmin</structfield> <type>xid</type>
+ </para>
+ <para>
+ This standby's <literal>xmin</literal> horizon reported
+ by <xref linkend="guc-hot-standby-feedback"/>.
+ </para></entry>
+ </row>
- <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">
- Column Type
+ <structfield>state</structfield> <type>text</type>
</para>
<para>
- Description
+ 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>
- </thead>
- <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>checkpoints_timed</structfield> <type>bigint</type>
+ <structfield>sent_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Number of scheduled checkpoints that have been performed
+ Last write-ahead log location sent on this connection
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>checkpoints_req</structfield> <type>bigint</type>
+ <structfield>write_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Number of requested checkpoints that have been performed
+ 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>checkpoint_write_time</structfield> <type>double precision</type>
+ <structfield>flush_lsn</structfield> <type>pg_lsn</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
+ 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>checkpoint_sync_time</structfield> <type>double precision</type>
+ <structfield>replay_lsn</structfield> <type>pg_lsn</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
+ 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>buffers_checkpoint</structfield> <type>bigint</type>
+ <structfield>write_lag</structfield> <type>interval</type>
</para>
<para>
- Number of buffers written during checkpoints
+ 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>buffers_clean</structfield> <type>bigint</type>
+ <structfield>flush_lag</structfield> <type>interval</type>
</para>
<para>
- Number of buffers written by the background writer
+ 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>maxwritten_clean</structfield> <type>bigint</type>
+ <structfield>replay_lag</structfield> <type>interval</type>
</para>
<para>
- Number of times the background writer stopped a cleaning
- scan because it had written too many buffers
+ 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>buffers_backend</structfield> <type>bigint</type>
+ <structfield>sync_priority</structfield> <type>integer</type>
</para>
<para>
- Number of buffers written directly by a backend
+ 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>buffers_backend_fsync</structfield> <type>bigint</type>
+ <structfield>sync_state</structfield> <type>text</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)
+ 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>buffers_alloc</structfield> <type>bigint</type>
+ <structfield>reply_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Number of buffers allocated
+ Send time of last reply message received from standby server
</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>
- <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>
+ <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-wal-view">
- <title><structname>pg_stat_wal</structname></title>
+ <sect2 id="monitoring-pg-stat-replication-slots-view">
+ <title><structname>pg_stat_replication_slots</structname></title>
<indexterm>
- <primary>pg_stat_wal</primary>
+ <primary>pg_stat_replication_slots</primary>
</indexterm>
<para>
- The <structname>pg_stat_wal</structname> view will always have a
- single row, containing data about WAL activity of the cluster.
+ 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-wal-view" xreflabel="pg_stat_wal">
- <title><structname>pg_stat_wal</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>
@@ -3784,126 +3993,147 @@ 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>wal_records</structfield> <type>bigint</type>
- </para>
- <para>
- Total number of WAL records generated
+ <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>wal_fpi</structfield> <type>bigint</type>
- </para>
- <para>
- Total number of WAL full page images generated
+ <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>wal_bytes</structfield> <type>numeric</type>
- </para>
- <para>
- Total amount of WAL generated in bytes
+ <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>wal_buffers_full</structfield> <type>bigint</type>
- </para>
- <para>
- Number of times WAL data was written to disk because WAL buffers became full
+ <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>wal_write</structfield> <type>bigint</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>.
- </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>wal_sync</structfield> <type>bigint</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>.
+ <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>wal_write_time</structfield> <type>double precision</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>.
- </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>wal_sync_time</structfield> <type>double precision</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).
- </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>stats_reset</structfield> <type>timestamp with time zone</type>
- </para>
- <para>
- Time at which these statistics were last reset
- </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>
- </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>
-</sect2>
+ </sect2>
- <sect2 id="monitoring-pg-stat-database-view">
- <title><structname>pg_stat_database</structname></title>
+ <sect2 id="monitoring-pg-stat-slru-view">
+ <title><structname>pg_stat_slru</structname></title>
<indexterm>
- <primary>pg_stat_database</primary>
+ <primary>SLRU</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>pg_stat_slru</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.
+ <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-database-view" xreflabel="pg_stat_database">
- <title><structname>pg_stat_database</structname> View</title>
+ <table id="pg-stat-slru-view" xreflabel="pg_stat_slru">
+ <title><structname>pg_stat_slru</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -3919,293 +4149,316 @@ 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>name</structfield> <type>text</type>
</para>
<para>
- OID of this database, or 0 for objects belonging to a shared
- relation
+ Name of the SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
+ <structfield>blks_zeroed</structfield> <type>bigint</type>
</para>
<para>
- Name of this database, or <literal>NULL</literal> for shared
- objects.
+ Number of blocks zeroed during initializations
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>numbackends</structfield> <type>integer</type>
+ <structfield>blks_hit</structfield> <type>bigint</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.
+ 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>xact_commit</structfield> <type>bigint</type>
+ <structfield>blks_read</structfield> <type>bigint</type>
</para>
<para>
- Number of transactions in this database that have been
- committed
+ Number of disk blocks read for this SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>xact_rollback</structfield> <type>bigint</type>
+ <structfield>blks_written</structfield> <type>bigint</type>
</para>
<para>
- Number of transactions in this database that have been
- rolled back
+ Number of disk blocks written for this SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>blks_read</structfield> <type>bigint</type>
+ <structfield>blks_exists</structfield> <type>bigint</type>
</para>
<para>
- Number of disk blocks read in this database
+ Number of blocks checked for existence for this SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>blks_hit</structfield> <type>bigint</type>
+ <structfield>flushes</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)
+ Number of flushes of dirty data for this SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tup_returned</structfield> <type>bigint</type>
+ <structfield>truncates</structfield> <type>bigint</type>
</para>
<para>
- Number of live rows fetched by sequential scans and index entries returned by index scans in this database
+ Number of truncates for this SLRU
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tup_fetched</structfield> <type>bigint</type>
+ <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Number of live rows fetched by index scans in this database
+ Time at which these statistics were last reset
</para></entry>
</row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-ssl-view">
+ <title><structname>pg_stat_ssl</structname></title>
+
+ <indexterm>
+ <primary>pg_stat_ssl</primary>
+ </indexterm>
+
+ <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>
+ <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">
- <structfield>tup_inserted</structfield> <type>bigint</type>
+ Column Type
</para>
<para>
- Number of rows inserted by queries in this database
+ Description
</para></entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tup_updated</structfield> <type>bigint</type>
+ <structfield>pid</structfield> <type>integer</type>
</para>
<para>
- Number of rows updated by queries in this database
+ Process ID of a backend or WAL sender process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tup_deleted</structfield> <type>bigint</type>
+ <structfield>ssl</structfield> <type>boolean</type>
</para>
<para>
- Number of rows deleted by queries in this database
+ True if SSL is used on this connection
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>conflicts</structfield> <type>bigint</type>
+ <structfield>version</structfield> <type>text</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.)
+ 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>temp_files</structfield> <type>bigint</type>
+ <structfield>cipher</structfield> <type>text</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.
+ 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>temp_bytes</structfield> <type>bigint</type>
+ <structfield>bits</structfield> <type>integer</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.
+ 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>deadlocks</structfield> <type>bigint</type>
+ <structfield>client_dn</structfield> <type>text</type>
</para>
<para>
- Number of deadlocks detected in this database
+ 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>checksum_failures</structfield> <type>bigint</type>
+ <structfield>client_serial</structfield> <type>numeric</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.
+ 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>checksum_last_failure</structfield> <type>timestamp with time zone</type>
+ <structfield>issuer_dn</structfield> <type>text</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.
+ 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>
+ </tgroup>
+ </table>
+
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-subscription">
+ <title><structname>pg_stat_subscription</structname></title>
+ <indexterm>
+ <primary>pg_stat_subscription</primary>
+ </indexterm>
+
+ <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+ <title><structname>pg_stat_subscription</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>subid</structfield> <type>oid</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)
+ OID of the subscription
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>session_time</structfield> <type>double precision</type>
+ <structfield>subname</structfield> <type>name</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)
+ Name of the subscription
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>active_time</structfield> <type>double precision</type>
+ <structfield>pid</structfield> <type>integer</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>)
+ Process ID of the subscription worker process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>idle_in_transaction_time</structfield> <type>double precision</type>
+ <structfield>relid</structfield> <type>oid</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>)
+ 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>sessions</structfield> <type>bigint</type>
+ <structfield>received_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Total number of sessions established to this database
+ 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>sessions_abandoned</structfield> <type>bigint</type>
+ <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Number of database sessions to this database that were terminated
- because connection to the client was lost
+ Send time of last message received from origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sessions_fatal</structfield> <type>bigint</type>
+ <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Number of database sessions to this database that were terminated
- by fatal errors
+ Receipt time of last message received from origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>sessions_killed</structfield> <type>bigint</type>
+ <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Number of database sessions to this database that were terminated
- by operator intervention
+ Last write-ahead log location reported to origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+ <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Time at which these statistics were last reset
+ Time of last write-ahead log location reported to origin WAL
+ sender
</para></entry>
</row>
</tbody>
@@ -4214,23 +4467,20 @@ 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-subscription-stats">
+ <title><structname>pg_stat_subscription_stats</structname></title>
<indexterm>
- <primary>pg_stat_database_conflicts</primary>
+ <primary>pg_stat_subscription_stats</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_subscription_stats</structname> view will contain
+ one row per subscription.
</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-subscription-stats" xreflabel="pg_stat_subscription_stats">
+ <title><structname>pg_stat_subscription_stats</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -4246,69 +4496,47 @@ 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 a database
- </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
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>confl_tablespace</structfield> <type>bigint</type>
+ <structfield>subid</structfield> <type>oid</type>
</para>
<para>
- Number of queries in this database that have been canceled due to
- dropped tablespaces
+ OID of the subscription
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>confl_lock</structfield> <type>bigint</type>
+ <structfield>subname</structfield> <type>name</type>
</para>
<para>
- Number of queries in this database that have been canceled due to
- lock timeouts
+ Name of the subscription
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>confl_snapshot</structfield> <type>bigint</type>
+ <structfield>apply_error_count</structfield> <type>bigint</type>
</para>
<para>
- Number of queries in this database that have been canceled due to
- old snapshots
+ Number of times an error occurred while applying changes
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>confl_bufferpin</structfield> <type>bigint</type>
+ <structfield>sync_error_count</structfield> <type>bigint</type>
</para>
<para>
- Number of queries in this database that have been canceled due to
- pinned buffers
+ 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>confl_deadlock</structfield> <type>bigint</type>
+ <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Number of queries in this database that have been canceled due to
- deadlocks
+ Time at which these statistics were last reset
</para></entry>
</row>
</tbody>
@@ -4317,25 +4545,22 @@ 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-user-functions-view">
+ <title><structname>pg_stat_user_functions</structname></title>
<indexterm>
- <primary>pg_stat_all_tables</primary>
+ <primary>pg_stat_user_functions</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.
+ 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-all-tables-view" xreflabel="pg_stat_all_tables">
- <title><structname>pg_stat_all_tables</structname> View</title>
+
+ <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>
@@ -4351,10 +4576,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>relid</structfield> <type>oid</type>
+ <structfield>funcid</structfield> <type>oid</type>
</para>
<para>
- OID of a table
+ OID of a function
</para></entry>
</row>
@@ -4363,378 +4588,365 @@ 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 that this table is in
+ Name of the schema this function is in
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relname</structfield> <type>name</type>
+ <structfield>funcname</structfield> <type>name</type>
</para>
<para>
- Name of this table
+ Name of this function
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>seq_scan</structfield> <type>bigint</type>
+ <structfield>calls</structfield> <type>bigint</type>
</para>
<para>
- Number of sequential scans initiated on this table
+ Number of times this function has been called
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_seq_scan</structfield> <type>timestamptz</type>
+ <structfield>total_time</structfield> <type>double precision</type>
</para>
<para>
- The time of the last sequential scan on this table, based on the
- most recent transaction stop time
+ 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>seq_tup_read</structfield> <type>bigint</type>
+ <structfield>self_time</structfield> <type>double precision</type>
</para>
<para>
- Number of live rows fetched by sequential scans
+ Total time spent in this function itself, not including
+ other functions called by it, in milliseconds
</para></entry>
</row>
+ </tbody>
+ </tgroup>
+ </table>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>idx_scan</structfield> <type>bigint</type>
- </para>
- <para>
- Number of index scans initiated on this table
- </para></entry>
- </row>
+ </sect2>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_idx_scan</structfield> <type>timestamptz</type>
- </para>
- <para>
- The time of the last index scan on this table, based on the
- most recent transaction stop time
- </para></entry>
- </row>
+ <sect2 id="monitoring-pg-stat-wal-view">
+ <title><structname>pg_stat_wal</structname></title>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>idx_tup_fetch</structfield> <type>bigint</type>
- </para>
- <para>
- Number of live rows fetched by index scans
- </para></entry>
- </row>
+ <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">
- <structfield>n_tup_ins</structfield> <type>bigint</type>
+ Column Type
</para>
<para>
- Number of rows inserted
+ Description
</para></entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>n_tup_upd</structfield> <type>bigint</type>
+ <structfield>wal_records</structfield> <type>bigint</type>
</para>
<para>
- Number of rows updated (includes <link linkend="storage-hot">HOT updated rows</link>)
+ Total number of WAL records generated
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>n_tup_del</structfield> <type>bigint</type>
+ <structfield>wal_fpi</structfield> <type>bigint</type>
</para>
<para>
- Number of rows deleted
+ Total number of WAL full page images generated
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>n_tup_hot_upd</structfield> <type>bigint</type>
+ <structfield>wal_bytes</structfield> <type>numeric</type>
</para>
<para>
- Number of rows HOT updated (i.e., with no separate index
- update required)
+ Total amount of WAL generated in bytes
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>n_live_tup</structfield> <type>bigint</type>
+ <structfield>wal_buffers_full</structfield> <type>bigint</type>
</para>
<para>
- Estimated number of live rows
+ 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>n_dead_tup</structfield> <type>bigint</type>
+ <structfield>wal_write</structfield> <type>bigint</type>
</para>
<para>
- Estimated number of dead rows
+ 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>n_mod_since_analyze</structfield> <type>bigint</type>
+ <structfield>wal_sync</structfield> <type>bigint</type>
</para>
<para>
- Estimated number of rows modified since this table was last analyzed
+ 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>n_ins_since_vacuum</structfield> <type>bigint</type>
+ <structfield>wal_write_time</structfield> <type>double precision</type>
</para>
<para>
- Estimated number of rows inserted since this table was last vacuumed
+ 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>last_vacuum</structfield> <type>timestamp with time zone</type>
+ <structfield>wal_sync_time</structfield> <type>double precision</type>
</para>
<para>
- Last time at which this table was manually vacuumed
- (not counting <command>VACUUM FULL</command>)
+ 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>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_autovacuum</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 vacuumed by the autovacuum
- daemon
+ Time at which these statistics were last reset
</para></entry>
</row>
+ </tbody>
+ </tgroup>
+ </table>
+
+</sect2>
+
+ <sect2 id="monitoring-pg-stat-wal-receiver-view">
+ <title><structname>pg_stat_wal_receiver</structname></title>
+
+ <indexterm>
+ <primary>pg_stat_wal_receiver</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.
+ </para>
+ <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>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_analyze</structfield> <type>timestamp with time zone</type>
+ Column Type
</para>
<para>
- Last time at which this table was manually analyzed
+ Description
</para></entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_autoanalyze</structfield> <type>timestamp with time zone</type>
+ <structfield>pid</structfield> <type>integer</type>
</para>
<para>
- Last time at which this table was analyzed by the autovacuum
- daemon
+ Process ID of the WAL receiver process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>vacuum_count</structfield> <type>bigint</type>
+ <structfield>status</structfield> <type>text</type>
</para>
<para>
- Number of times this table has been manually vacuumed
- (not counting <command>VACUUM FULL</command>)
+ Activity status of the WAL receiver process
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>autovacuum_count</structfield> <type>bigint</type>
+ <structfield>receive_start_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Number of times this table has been vacuumed by the autovacuum
- daemon
+ 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>analyze_count</structfield> <type>bigint</type>
+ <structfield>receive_start_tli</structfield> <type>integer</type>
</para>
<para>
- Number of times this table has been manually analyzed
+ First timeline number used when WAL receiver is started
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>autoanalyze_count</structfield> <type>bigint</type>
+ <structfield>written_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Number of times this table has been analyzed by the autovacuum
- daemon
+ 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>
- </tbody>
- </tgroup>
- </table>
-
- </sect2>
-
- <sect2 id="monitoring-pg-stat-all-indexes-view">
- <title><structname>pg_stat_all_indexes</structname></title>
-
- <indexterm>
- <primary>pg_stat_all_indexes</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.
- </para>
- <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>
<entry role="catalog_table_entry"><para role="column_definition">
- Column Type
+ <structfield>flushed_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Description
+ 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>
- </thead>
- <tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
+ <structfield>received_tli</structfield> <type>integer</type>
</para>
<para>
- OID of the table for this index
+ 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>indexrelid</structfield> <type>oid</type>
+ <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- OID of this index
+ Send time of last message received from origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>schemaname</structfield> <type>name</type>
+ <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Name of the schema this index is in
+ Receipt time of last message received from origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relname</structfield> <type>name</type>
+ <structfield>latest_end_lsn</structfield> <type>pg_lsn</type>
</para>
<para>
- Name of the table for this index
+ Last write-ahead log location reported to origin WAL sender
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>indexrelname</structfield> <type>name</type>
+ <structfield>latest_end_time</structfield> <type>timestamp with time zone</type>
</para>
<para>
- Name of this index
+ 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>idx_scan</structfield> <type>bigint</type>
+ <structfield>slot_name</structfield> <type>text</type>
</para>
<para>
- Number of index scans initiated on this index
+ Replication slot name used by this WAL receiver
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>last_idx_scan</structfield> <type>timestamptz</type>
+ <structfield>sender_host</structfield> <type>text</type>
</para>
<para>
- The time of the last scan on this index, based on the
- most recent transaction stop time
+ 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>idx_tup_read</structfield> <type>bigint</type>
+ <structfield>sender_port</structfield> <type>integer</type>
</para>
<para>
- Number of index entries returned by scans on this index
+ 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>idx_tup_fetch</structfield> <type>bigint</type>
+ <structfield>conninfo</structfield> <type>text</type>
</para>
<para>
- Number of live table rows fetched by simple index scans using this
- index
+ Connection string used by this WAL receiver,
+ with security-sensitive fields obfuscated.
</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-statio-all-tables-view">
@@ -5051,218 +5263,6 @@ 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>
-
- <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">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>funcid</structfield> <type>oid</type>
- </para>
- <para>
- OID of a function
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <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
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>name</structfield> <type>text</type>
- </para>
- <para>
- Name of the SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>blks_zeroed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks zeroed during initializations
- </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 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>blks_read</structfield> <type>bigint</type>
- </para>
- <para>
- Number of disk blocks read for this SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>blks_written</structfield> <type>bigint</type>
- </para>
- <para>
- Number of disk blocks written for this SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>blks_exists</structfield> <type>bigint</type>
- </para>
- <para>
- Number of blocks checked for existence for this SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>flushes</structfield> <type>bigint</type>
- </para>
- <para>
- Number of flushes of dirty data for this SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>truncates</structfield> <type>bigint</type>
- </para>
- <para>
- Number of truncates for this SLRU
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
- </para>
- <para>
- Time at which these statistics were last reset
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- </sect2>
-
<sect2 id="monitoring-stats-functions">
<title>Statistics Functions</title>
--
1.8.3.1
Peter Smith <smithpb2250@gmail.com> writes:
Sorry, I forgot the attachments in the previous post. PSA.
I spent a bit of time looking at this. I agree that a lot of the
current ordering choices here look like they were made with the
advice of a dartboard, and there's a number of things that are
pretty blatantly just sloppy merging (like the out-of-order
wait-event items). However, I'm not a big fan of "alphabetical
order at all costs", because that frequently leads to ordering
decisions that are not a lot better than random from a semantic
standpoint. For example, I resist the idea that it's sensible
to put pg_stat_all_indexes before pg_stat_all_tables.
I'm unconvinced that putting pg_stat_sys_tables and
pg_stat_user_tables far away from pg_stat_all_tables is great,
either.
So ... how do we proceed?
One thing I'm unhappy about that you didn't address is that
the subsection ordering in "28.4. Progress Reporting" could
hardly have been invented even with a dartboard. Perhaps it
reflects development order, but that's a poor excuse.
I'd be inclined to alphabetize by SQL command name, but maybe
leave Base Backup to the end since it's not a SQL command.
regards, tom lane
On Mon, Nov 7, 2022 at 5:50 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Smith <smithpb2250@gmail.com> writes:
Sorry, I forgot the attachments in the previous post. PSA.
I spent a bit of time looking at this. I agree that a lot of the
current ordering choices here look like they were made with the
advice of a dartboard, and there's a number of things that are
pretty blatantly just sloppy merging (like the out-of-order
wait-event items). However, I'm not a big fan of "alphabetical
order at all costs", because that frequently leads to ordering
decisions that are not a lot better than random from a semantic
standpoint. For example, I resist the idea that it's sensible
to put pg_stat_all_indexes before pg_stat_all_tables.
I'm unconvinced that putting pg_stat_sys_tables and
pg_stat_user_tables far away from pg_stat_all_tables is great,
either.
Thanks for taking the time to look at my patch. The "at all costs"
approach was not the intention - I was just trying only to apply some
sane ordering where I did not recognize a reason for the current
order.
So ... how do we proceed?
To proceed with the existing patches I need some guidance on exactly
which of the changes can be considered improvements versus which ones
are maybe just trading one 'random' order for another.
How about below?
Table 28.1. Dynamic Statistics Views -- Alphabetical order would be a
small improvement here, right?
Table 28.2. Collected Statistics Views -- Leave this one unchanged
(per your comments above).
Table 28.12 Wait Events of type LWLock -- Seems a clear case of bad
merging. Alphabetical order is surely needed here, right?
Table 28.34 Additional Statistic Functions -- Alphabetical order would
be a small improvement here, right?
Table 28.35 Per-Backend Statistics Functions -- Alphabetical order
would be a small improvement here, right?
One thing I'm unhappy about that you didn't address is that
the subsection ordering in "28.4. Progress Reporting" could
hardly have been invented even with a dartboard. Perhaps it
reflects development order, but that's a poor excuse.
I'd be inclined to alphabetize by SQL command name, but maybe
leave Base Backup to the end since it's not a SQL command.
Yes, I had previously only looked at the content of section 28.2
because I didn't want to get carried away by changing too much until
there was some support for doing the first part.
Now PSA a separate patch for fixing section "28.4. Progress Reporting"
order as suggested.
-----
Kind Regards,
Peter Smith.
Fujitsu Australia.
Attachments:
v4-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchapplication/octet-stream; name=v4-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchDownload
From 263cd61099528bd510bbcf8ffbe870c05d2d16df Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 8 Nov 2022 11:01:04 +1100
Subject: [PATCH v4] Re-order sections of "28.4. Progress Reporting"
BEFORE
28.4.1. ANALYZE Progress Reporting
28.4.2. CREATE INDEX Progress Reporting
28.4.3. VACUUM Progress Reporting
28.4.4. CLUSTER Progress Reporting
28.4.5. Base Backup Progress Reporting
28.4.6. COPY Progress Reporting
AFTER
28.4.1. ANALYZE Progress Reporting
28.4.2. CLUSTER Progress Reporting
28.4.3. COPY Progress Reporting
28.4.4. CREATE INDEX Progress Reporting
28.4.5. VACUUM Progress Reporting
28.4.6. Base Backup Progress Reporting
---
doc/src/sgml/monitoring.sgml | 840 +++++++++++++++++++++----------------------
1 file changed, 420 insertions(+), 420 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index e5d622d..31f457e 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6008,6 +6008,362 @@ FROM pg_stat_get_backend_idset() AS backendid;
</note>
</sect2>
+ <sect2 id="cluster-progress-reporting">
+ <title>CLUSTER Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_cluster</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
+ running, the <structname>pg_stat_progress_cluster</structname> view will
+ contain a row for each backend that is currently running either command.
+ The tables below describe the information that will be reported and
+ provide information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
+ <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table being clustered.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>phase</structfield> <type>text</type>
+ </para>
+ <para>
+ Current processing phase. See <xref linkend="cluster-phases"/>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>cluster_index_relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ If the table is being scanned using an index, this is the OID of the
+ index being used; otherwise, it is zero.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples scanned.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples written.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap blocks scanned. This counter only advances when the
+ phase is <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of indexes rebuilt. This counter only advances when the phase
+ is <literal>rebuilding index</literal>.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="cluster-phases">
+ <title>CLUSTER and VACUUM FULL Phases</title>
+ <tgroup cols="2">
+ <colspec colname="col1" colwidth="1*"/>
+ <colspec colname="col2" colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Phase</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>initializing</literal></entry>
+ <entry>
+ The command is preparing to begin scanning the heap. This phase is
+ expected to be very brief.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>seq scanning heap</literal></entry>
+ <entry>
+ The command is currently scanning the table using a sequential scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>index scanning heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently scanning the table using an index scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>sorting tuples</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently sorting tuples.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>writing new heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently writing the new heap.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>swapping relation files</literal></entry>
+ <entry>
+ The command is currently swapping newly-built files into place.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>rebuilding index</literal></entry>
+ <entry>
+ The command is currently rebuilding an index.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>performing final cleanup</literal></entry>
+ <entry>
+ The command is performing final cleanup. When this phase is
+ completed, <command>CLUSTER</command>
+ or <command>VACUUM FULL</command> will end.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="copy-progress-reporting">
+ <title>COPY Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_copy</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>COPY</command> is running, the
+ <structname>pg_stat_progress_copy</structname> view will contain one row
+ for each backend that is currently running a <command>COPY</command> command.
+ The table below describes the information that will be reported and provides
+ information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
+ <title><structname>pg_stat_progress_copy</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table on which the <command>COPY</command> command is
+ executed. It is set to <literal>0</literal> if copying from a
+ <command>SELECT</command> query.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running: <literal>COPY FROM</literal>, or
+ <literal>COPY TO</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>type</structfield> <type>text</type>
+ </para>
+ <para>
+ The io type that the data is read from or written to:
+ <literal>FILE</literal>, <literal>PROGRAM</literal>,
+ <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
+ <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
+ (used for example during the initial table synchronization in
+ logical replication).
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of bytes already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Size of source file for <command>COPY FROM</command> command in bytes.
+ It is set to <literal>0</literal> if not available.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_excluded</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples not processed because they were excluded by the
+ <command>WHERE</command> clause of the <command>COPY</command> command.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
<sect2 id="create-index-progress-reporting">
<title>CREATE INDEX Progress Reporting</title>
@@ -6330,234 +6686,8 @@ FROM pg_stat_get_backend_idset() AS backendid;
in place. See <xref linkend='cluster-progress-reporting'/>.
</para>
- <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
- <title><structname>pg_stat_progress_vacuum</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table being vacuumed.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>phase</structfield> <type>text</type>
- </para>
- <para>
- Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
- </para>
- <para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of the scan; blocks added later will not be (and
- need not be) visited by this <command>VACUUM</command>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks scanned. Because the
- <link linkend="storage-vm">visibility map</link> is used to optimize scans,
- some blocks will be skipped without inspection; skipped blocks are
- included in this total, so that this number will eventually become
- equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
- This counter only advances when the phase is <literal>scanning heap</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks vacuumed. Unless the table has no indexes, this
- counter only advances when the phase is <literal>vacuuming heap</literal>.
- Blocks that contain no dead tuples are skipped, so the counter may
- sometimes skip forward in large increments.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_vacuum_count</structfield> <type>bigint</type>
- </para>
- <para>
- Number of completed index vacuum cycles.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>max_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples that we can store before needing to perform
- an index vacuum cycle, based on
- <xref linkend="guc-maintenance-work-mem"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>num_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples collected since the last index vacuum cycle.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="vacuum-phases">
- <title>VACUUM Phases</title>
- <tgroup cols="2">
- <colspec colname="col1" colwidth="1*"/>
- <colspec colname="col2" colwidth="2*"/>
- <thead>
- <row>
- <entry>Phase</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>initializing</literal></entry>
- <entry>
- <command>VACUUM</command> is preparing to begin scanning the heap. This
- phase is expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>scanning heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently scanning the heap. It will prune and
- defragment each page if required, and possibly perform freezing
- activity. The <structfield>heap_blks_scanned</structfield> column can be used
- to monitor the progress of the scan.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the indexes. If a table has
- any indexes, this will happen at least once per vacuum, after the heap
- has been completely scanned. It may happen multiple times per vacuum
- if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
- <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
- the number of dead tuples found.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
- is distinct from scanning the heap, and occurs after each instance of
- vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
- <structfield>heap_blks_total</structfield>, the system will return to scanning
- the heap after this phase is completed; otherwise, it will begin
- cleaning up indexes after this phase is completed.
- </entry>
- </row>
- <row>
- <entry><literal>cleaning up indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently cleaning up indexes. This occurs after
- the heap has been completely scanned and all vacuuming of the indexes
- and the heap has been completed.
- </entry>
- </row>
- <row>
- <entry><literal>truncating heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently truncating the heap so as to return
- empty pages at the end of the relation to the operating system. This
- occurs after cleaning up indexes.
- </entry>
- </row>
- <row>
- <entry><literal>performing final cleanup</literal></entry>
- <entry>
- <command>VACUUM</command> is performing final cleanup. During this phase,
- <command>VACUUM</command> will vacuum the free space map, update statistics
- in <literal>pg_class</literal>, and report statistics to the cumulative
- statistics system. When this phase is completed, <command>VACUUM</command> will end.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- </sect2>
-
- <sect2 id="cluster-progress-reporting">
- <title>CLUSTER Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_cluster</primary>
- </indexterm>
-
- <para>
- Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
- running, the <structname>pg_stat_progress_cluster</structname> view will
- contain a row for each backend that is currently running either command.
- The tables below describe the information that will be reported and
- provide information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
- <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
+ <title><structname>pg_stat_progress_vacuum</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -6603,16 +6733,7 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>relid</structfield> <type>oid</type>
</para>
<para>
- OID of the table being clustered.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ OID of the table being vacuumed.
</para></entry>
</row>
@@ -6621,81 +6742,81 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>phase</structfield> <type>text</type>
</para>
<para>
- Current processing phase. See <xref linkend="cluster-phases"/>.
+ Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>cluster_index_relid</structfield> <type>oid</type>
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
</para>
<para>
- If the table is being scanned using an index, this is the OID of the
- index being used; otherwise, it is zero.
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of the scan; blocks added later will not be (and
+ need not be) visited by this <command>VACUUM</command>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples scanned.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks scanned. Because the
+ <link linkend="storage-vm">visibility map</link> is used to optimize scans,
+ some blocks will be skipped without inspection; skipped blocks are
+ included in this total, so that this number will eventually become
+ equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
+ This counter only advances when the phase is <literal>scanning heap</literal>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples written.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks vacuumed. Unless the table has no indexes, this
+ counter only advances when the phase is <literal>vacuuming heap</literal>.
+ Blocks that contain no dead tuples are skipped, so the counter may
+ sometimes skip forward in large increments.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
+ <structfield>index_vacuum_count</structfield> <type>bigint</type>
</para>
<para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of <literal>seq scanning heap</literal>.
+ Number of completed index vacuum cycles.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ <structfield>max_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of heap blocks scanned. This counter only advances when the
- phase is <literal>seq scanning heap</literal>.
+ Number of dead tuples that we can store before needing to perform
+ an index vacuum cycle, based on
+ <xref linkend="guc-maintenance-work-mem"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ <structfield>num_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of indexes rebuilt. This counter only advances when the phase
- is <literal>rebuilding index</literal>.
+ Number of dead tuples collected since the last index vacuum cycle.
</para></entry>
</row>
</tbody>
</tgroup>
</table>
- <table id="cluster-phases">
- <title>CLUSTER and VACUUM FULL Phases</title>
+ <table id="vacuum-phases">
+ <title>VACUUM Phases</title>
<tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="2*"/>
@@ -6710,57 +6831,70 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry><literal>initializing</literal></entry>
<entry>
- The command is preparing to begin scanning the heap. This phase is
- expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>seq scanning heap</literal></entry>
- <entry>
- The command is currently scanning the table using a sequential scan.
+ <command>VACUUM</command> is preparing to begin scanning the heap. This
+ phase is expected to be very brief.
</entry>
</row>
<row>
- <entry><literal>index scanning heap</literal></entry>
+ <entry><literal>scanning heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently scanning the table using an index scan.
+ <command>VACUUM</command> is currently scanning the heap. It will prune and
+ defragment each page if required, and possibly perform freezing
+ activity. The <structfield>heap_blks_scanned</structfield> column can be used
+ to monitor the progress of the scan.
</entry>
</row>
<row>
- <entry><literal>sorting tuples</literal></entry>
+ <entry><literal>vacuuming indexes</literal></entry>
<entry>
- <command>CLUSTER</command> is currently sorting tuples.
+ <command>VACUUM</command> is currently vacuuming the indexes. If a table has
+ any indexes, this will happen at least once per vacuum, after the heap
+ has been completely scanned. It may happen multiple times per vacuum
+ if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
+ <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
+ the number of dead tuples found.
</entry>
</row>
<row>
- <entry><literal>writing new heap</literal></entry>
+ <entry><literal>vacuuming heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently writing the new heap.
+ <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
+ is distinct from scanning the heap, and occurs after each instance of
+ vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
+ <structfield>heap_blks_total</structfield>, the system will return to scanning
+ the heap after this phase is completed; otherwise, it will begin
+ cleaning up indexes after this phase is completed.
</entry>
</row>
<row>
- <entry><literal>swapping relation files</literal></entry>
+ <entry><literal>cleaning up indexes</literal></entry>
<entry>
- The command is currently swapping newly-built files into place.
+ <command>VACUUM</command> is currently cleaning up indexes. This occurs after
+ the heap has been completely scanned and all vacuuming of the indexes
+ and the heap has been completed.
</entry>
</row>
<row>
- <entry><literal>rebuilding index</literal></entry>
+ <entry><literal>truncating heap</literal></entry>
<entry>
- The command is currently rebuilding an index.
+ <command>VACUUM</command> is currently truncating the heap so as to return
+ empty pages at the end of the relation to the operating system. This
+ occurs after cleaning up indexes.
</entry>
</row>
<row>
<entry><literal>performing final cleanup</literal></entry>
<entry>
- The command is performing final cleanup. When this phase is
- completed, <command>CLUSTER</command>
- or <command>VACUUM FULL</command> will end.
+ <command>VACUUM</command> is performing final cleanup. During this phase,
+ <command>VACUUM</command> will vacuum the free space map, update statistics
+ in <literal>pg_class</literal>, and report statistics to the cumulative
+ statistics system. When this phase is completed, <command>VACUUM</command> will end.
</entry>
</row>
</tbody>
</tgroup>
</table>
+
</sect2>
<sect2 id="basebackup-progress-reporting">
@@ -6938,140 +7072,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
</sect2>
- <sect2 id="copy-progress-reporting">
- <title>COPY Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_copy</primary>
- </indexterm>
-
- <para>
- Whenever <command>COPY</command> is running, the
- <structname>pg_stat_progress_copy</structname> view will contain one row
- for each backend that is currently running a <command>COPY</command> command.
- The table below describes the information that will be reported and provides
- information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
- <title><structname>pg_stat_progress_copy</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table on which the <command>COPY</command> command is
- executed. It is set to <literal>0</literal> if copying from a
- <command>SELECT</command> query.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running: <literal>COPY FROM</literal>, or
- <literal>COPY TO</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>type</structfield> <type>text</type>
- </para>
- <para>
- The io type that the data is read from or written to:
- <literal>FILE</literal>, <literal>PROGRAM</literal>,
- <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
- <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
- (used for example during the initial table synchronization in
- logical replication).
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of bytes already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_total</structfield> <type>bigint</type>
- </para>
- <para>
- Size of source file for <command>COPY FROM</command> command in bytes.
- It is set to <literal>0</literal> if not available.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_excluded</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples not processed because they were excluded by the
- <command>WHERE</command> clause of the <command>COPY</command> command.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
</sect1>
<sect1 id="dynamic-trace">
--
1.8.3.1
On Mon, Nov 7, 2022 at 5:19 PM Peter Smith <smithpb2250@gmail.com> wrote:
On Mon, Nov 7, 2022 at 5:50 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Smith <smithpb2250@gmail.com> writes:
Sorry, I forgot the attachments in the previous post. PSA.
I spent a bit of time looking at this. I agree that a lot of the
current ordering choices here look like they were made with the
advice of a dartboard, and there's a number of things that are
pretty blatantly just sloppy merging (like the out-of-order
wait-event items). However, I'm not a big fan of "alphabetical
order at all costs", because that frequently leads to ordering
decisions that are not a lot better than random from a semantic
standpoint. For example, I resist the idea that it's sensible
to put pg_stat_all_indexes before pg_stat_all_tables.
I'm unconvinced that putting pg_stat_sys_tables and
pg_stat_user_tables far away from pg_stat_all_tables is great,
either.Thanks for taking the time to look at my patch. The "at all costs"
approach was not the intention - I was just trying only to apply some
sane ordering where I did not recognize a reason for the current
order.So ... how do we proceed?
To proceed with the existing patches I need some guidance on exactly
which of the changes can be considered improvements versus which ones
are maybe just trading one 'random' order for another.How about below?
Table 28.1. Dynamic Statistics Views -- Alphabetical order would be a
small improvement here, right?
The present ordering seems mostly OK, though just like the "Progress"
update below the bottom 6 pg_stat_progress_* entries should be
alphabetized; but leaving them as a group at the end seems desirable.
Move pg_stat_recovery_prefetch either after subscription or after activity
- the replication/received/subscription stuff all seems like it should be
grouped together. As well as the security related ssl/gssapi.
Table 28.2. Collected Statistics Views -- Leave this one unchanged
(per your comments above).
I would suggest moving the 3 pg_statio_*_tables rows between the
pg_stat_*_tables and the pg_stat_xact_*_tables groups.
Everything pertaining to cluster, database, tables, indexes, functions.
slru and replication slots should likewise shift to the (near) top in the
cluster/database grouping.
Table 28.12 Wait Events of type LWLock -- Seems a clear case of bad
merging. Alphabetical order is surely needed here, right?
+1 Agreed.
Table 28.34 Additional Statistic Functions -- Alphabetical order would
be a small improvement here, right?
No. All "reset" items should be grouped at the end like they are. I don't
see an alternative ordering among them that is clearly superior. Same for
the first four.
Table 28.35 Per-Backend Statistics Functions -- Alphabetical order
would be a small improvement here, right?
This one I would rearrange alphabetically. Or, at least, I have a
different opinion of what would make a decent order but it doesn't seem all
that clearly better than alphabetical.
I'd be inclined to alphabetize by SQL command name, but maybe
leave Base Backup to the end since it's not a SQL command.Yes, I had previously only looked at the content of section 28.2
because I didn't want to get carried away by changing too much until
there was some support for doing the first part.Now PSA a separate patch for fixing section "28.4. Progress Reporting"
order as suggested.
This seems like a clear win.
David J.
On Thu, Nov 10, 2022 at 10:04 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:
...
So ... how do we proceed?
To proceed with the existing patches I need some guidance on exactly
which of the changes can be considered improvements versus which ones
are maybe just trading one 'random' order for another.How about below?
Table 28.1. Dynamic Statistics Views -- Alphabetical order would be a
small improvement here, right?The present ordering seems mostly OK, though just like the "Progress" update below the bottom 6 pg_stat_progress_* entries should be alphabetized; but leaving them as a group at the end seems desirable.
Move pg_stat_recovery_prefetch either after subscription or after activity - the replication/received/subscription stuff all seems like it should be grouped together. As well as the security related ssl/gssapi.
Table 28.2. Collected Statistics Views -- Leave this one unchanged
(per your comments above).I would suggest moving the 3 pg_statio_*_tables rows between the pg_stat_*_tables and the pg_stat_xact_*_tables groups.
Everything pertaining to cluster, database, tables, indexes, functions. slru and replication slots should likewise shift to the (near) top in the cluster/database grouping.
Table 28.12 Wait Events of type LWLock -- Seems a clear case of bad
merging. Alphabetical order is surely needed here, right?+1 Agreed.
Table 28.34 Additional Statistic Functions -- Alphabetical order would
be a small improvement here, right?No. All "reset" items should be grouped at the end like they are. I don't see an alternative ordering among them that is clearly superior. Same for the first four.
Table 28.35 Per-Backend Statistics Functions -- Alphabetical order
would be a small improvement here, right?This one I would rearrange alphabetically. Or, at least, I have a different opinion of what would make a decent order but it doesn't seem all that clearly better than alphabetical.
I'd be inclined to alphabetize by SQL command name, but maybe
leave Base Backup to the end since it's not a SQL command.Yes, I had previously only looked at the content of section 28.2
because I didn't want to get carried away by changing too much until
there was some support for doing the first part.Now PSA a separate patch for fixing section "28.4. Progress Reporting"
order as suggested.This seems like a clear win.
David J.
Thanks for the review and table ordering advice. AFAICT I have made
all the changes according to the suggestions.
Each re-ordering was done as a separate patch (so maybe they can be
pushed separately, in case some but not all are OK). PSA.
~~
I was also wondering (but have not yet done) if the content *outside*
the tables should be reordered to match the table 28.1/28.2 order.
e.g. Currently it is not quite the same:
CURRENT
28.2.3. pg_stat_activity
28.2.4. pg_stat_replication
28.2.5. pg_stat_replication_slots
28.2.6. pg_stat_wal_receiver
28.2.7. pg_stat_recovery_prefetch
28.2.8. pg_stat_subscription
28.2.9. pg_stat_subscription_stats
28.2.10. pg_stat_ssl
28.2.11. pg_stat_gssapi
28.2.12. pg_stat_archiver
28.2.13. pg_stat_bgwriter
28.2.14. pg_stat_wal
28.2.15. pg_stat_database
28.2.16. pg_stat_database_conflicts
28.2.17. pg_stat_all_tables
28.2.18. pg_stat_all_indexes
28.2.19. pg_statio_all_tables
28.2.20. pg_statio_all_indexes
28.2.21. pg_statio_all_sequences
28.2.22. pg_stat_user_functions
28.2.23. pg_stat_slru
SUGGESTED
28.2.3. pg_stat_activity
28.2.4. pg_stat_replication
28.2.6. pg_stat_wal_receiver
28.2.7. pg_stat_recovery_prefetch
28.2.8. pg_stat_subscription
28.2.10. pg_stat_ssl
28.2.11. pg_stat_gssapi
28.2.12. pg_stat_archiver
28.2.13. pg_stat_bgwriter
28.2.14. pg_stat_wal
28.2.15. pg_stat_database
28.2.16. pg_stat_database_conflicts
28.2.23. pg_stat_slru
28.2.5. pg_stat_replication_slots
28.2.17. pg_stat_all_tables
28.2.18. pg_stat_all_indexes
28.2.19. pg_statio_all_tables
28.2.20. pg_statio_all_indexes
28.2.21. pg_statio_all_sequences
28.2.22. pg_stat_user_functions
28.2.9. pg_stat_subscription_stats
Thoughts?
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v5-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patchapplication/octet-stream; name=v5-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patchDownload
From 5b524530f69f5f5e5b8d6980f51c194242f0a06b Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 16 Nov 2022 12:26:56 +1100
Subject: [PATCH v5] Re-order Table 28.35 "Per-Backend Statistics Functions"
---
doc/src/sgml/monitoring.sgml | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index b80297f..2f10413 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5564,19 +5564,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_idset</primary>
- </indexterm>
- <function>pg_stat_get_backend_idset</function> ()
- <returnvalue>setof integer</returnvalue>
- </para>
- <para>
- Returns the set of currently active backend ID numbers.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_get_backend_activity</primary>
</indexterm>
<function>pg_stat_get_backend_activity</function> ( <type>integer</type> )
@@ -5642,6 +5629,19 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_get_backend_idset</primary>
+ </indexterm>
+ <function>pg_stat_get_backend_idset</function> ()
+ <returnvalue>setof integer</returnvalue>
+ </para>
+ <para>
+ Returns the set of currently active backend ID numbers.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_backend_pid</primary>
</indexterm>
<function>pg_stat_get_backend_pid</function> ( <type>integer</type> )
@@ -5681,29 +5681,29 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event_type</primary>
+ <primary>pg_stat_get_backend_wait_event</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event type name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-table"/> for details.
+ Returns the wait event name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
+ <xref linkend="wait-event-timeout-table"/>.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event</primary>
+ <primary>pg_stat_get_backend_wait_event_type</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
- <xref linkend="wait-event-timeout-table"/>.
+ Returns the wait event type name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-table"/> for details.
</para></entry>
</row>
--
1.8.3.1
v5-0002-Re-order-Table-28.2-Collected-Statistics-Views.patchapplication/octet-stream; name=v5-0002-Re-order-Table-28.2-Collected-Statistics-Views.patchDownload
From b5a2332518aff3cb09f6d7b34bde0c37a28d9959 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 16 Nov 2022 10:47:10 +1100
Subject: [PATCH v5] Re-order Table 28.2 "Collected Statistics Views"
---
doc/src/sgml/monitoring.sgml | 78 ++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 31f457e..c472a31 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -475,6 +475,23 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -497,6 +514,28 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
@@ -540,28 +579,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
<entry>
One row for each index in the current database,
@@ -624,23 +641,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
<entry>One row per subscription, showing statistics about errors.
See <link linkend="monitoring-pg-stat-subscription-stats">
--
1.8.3.1
v5-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchapplication/octet-stream; name=v5-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchDownload
From d4f919329eb23a1c58d16f570df4cdc3f1a99a45 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 16 Nov 2022 09:29:37 +1100
Subject: [PATCH v5] Re-order sections of "28.4. Progress Reporting"
BEFORE
28.4.1. ANALYZE Progress Reporting
28.4.2. CREATE INDEX Progress Reporting
28.4.3. VACUUM Progress Reporting
28.4.4. CLUSTER Progress Reporting
28.4.5. Base Backup Progress Reporting
28.4.6. COPY Progress Reporting
AFTER
28.4.1. ANALYZE Progress Reporting
28.4.2. CLUSTER Progress Reporting
28.4.3. COPY Progress Reporting
28.4.4. CREATE INDEX Progress Reporting
28.4.5. VACUUM Progress Reporting
28.4.6. Base Backup Progress Reporting
---
doc/src/sgml/monitoring.sgml | 840 +++++++++++++++++++++----------------------
1 file changed, 420 insertions(+), 420 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index e5d622d..31f457e 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6008,6 +6008,362 @@ FROM pg_stat_get_backend_idset() AS backendid;
</note>
</sect2>
+ <sect2 id="cluster-progress-reporting">
+ <title>CLUSTER Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_cluster</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
+ running, the <structname>pg_stat_progress_cluster</structname> view will
+ contain a row for each backend that is currently running either command.
+ The tables below describe the information that will be reported and
+ provide information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
+ <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table being clustered.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>phase</structfield> <type>text</type>
+ </para>
+ <para>
+ Current processing phase. See <xref linkend="cluster-phases"/>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>cluster_index_relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ If the table is being scanned using an index, this is the OID of the
+ index being used; otherwise, it is zero.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples scanned.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples written.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap blocks scanned. This counter only advances when the
+ phase is <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of indexes rebuilt. This counter only advances when the phase
+ is <literal>rebuilding index</literal>.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="cluster-phases">
+ <title>CLUSTER and VACUUM FULL Phases</title>
+ <tgroup cols="2">
+ <colspec colname="col1" colwidth="1*"/>
+ <colspec colname="col2" colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Phase</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>initializing</literal></entry>
+ <entry>
+ The command is preparing to begin scanning the heap. This phase is
+ expected to be very brief.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>seq scanning heap</literal></entry>
+ <entry>
+ The command is currently scanning the table using a sequential scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>index scanning heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently scanning the table using an index scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>sorting tuples</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently sorting tuples.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>writing new heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently writing the new heap.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>swapping relation files</literal></entry>
+ <entry>
+ The command is currently swapping newly-built files into place.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>rebuilding index</literal></entry>
+ <entry>
+ The command is currently rebuilding an index.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>performing final cleanup</literal></entry>
+ <entry>
+ The command is performing final cleanup. When this phase is
+ completed, <command>CLUSTER</command>
+ or <command>VACUUM FULL</command> will end.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="copy-progress-reporting">
+ <title>COPY Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_copy</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>COPY</command> is running, the
+ <structname>pg_stat_progress_copy</structname> view will contain one row
+ for each backend that is currently running a <command>COPY</command> command.
+ The table below describes the information that will be reported and provides
+ information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
+ <title><structname>pg_stat_progress_copy</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table on which the <command>COPY</command> command is
+ executed. It is set to <literal>0</literal> if copying from a
+ <command>SELECT</command> query.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running: <literal>COPY FROM</literal>, or
+ <literal>COPY TO</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>type</structfield> <type>text</type>
+ </para>
+ <para>
+ The io type that the data is read from or written to:
+ <literal>FILE</literal>, <literal>PROGRAM</literal>,
+ <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
+ <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
+ (used for example during the initial table synchronization in
+ logical replication).
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of bytes already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Size of source file for <command>COPY FROM</command> command in bytes.
+ It is set to <literal>0</literal> if not available.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_excluded</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples not processed because they were excluded by the
+ <command>WHERE</command> clause of the <command>COPY</command> command.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
<sect2 id="create-index-progress-reporting">
<title>CREATE INDEX Progress Reporting</title>
@@ -6330,234 +6686,8 @@ FROM pg_stat_get_backend_idset() AS backendid;
in place. See <xref linkend='cluster-progress-reporting'/>.
</para>
- <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
- <title><structname>pg_stat_progress_vacuum</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table being vacuumed.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>phase</structfield> <type>text</type>
- </para>
- <para>
- Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
- </para>
- <para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of the scan; blocks added later will not be (and
- need not be) visited by this <command>VACUUM</command>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks scanned. Because the
- <link linkend="storage-vm">visibility map</link> is used to optimize scans,
- some blocks will be skipped without inspection; skipped blocks are
- included in this total, so that this number will eventually become
- equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
- This counter only advances when the phase is <literal>scanning heap</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks vacuumed. Unless the table has no indexes, this
- counter only advances when the phase is <literal>vacuuming heap</literal>.
- Blocks that contain no dead tuples are skipped, so the counter may
- sometimes skip forward in large increments.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_vacuum_count</structfield> <type>bigint</type>
- </para>
- <para>
- Number of completed index vacuum cycles.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>max_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples that we can store before needing to perform
- an index vacuum cycle, based on
- <xref linkend="guc-maintenance-work-mem"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>num_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples collected since the last index vacuum cycle.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="vacuum-phases">
- <title>VACUUM Phases</title>
- <tgroup cols="2">
- <colspec colname="col1" colwidth="1*"/>
- <colspec colname="col2" colwidth="2*"/>
- <thead>
- <row>
- <entry>Phase</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>initializing</literal></entry>
- <entry>
- <command>VACUUM</command> is preparing to begin scanning the heap. This
- phase is expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>scanning heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently scanning the heap. It will prune and
- defragment each page if required, and possibly perform freezing
- activity. The <structfield>heap_blks_scanned</structfield> column can be used
- to monitor the progress of the scan.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the indexes. If a table has
- any indexes, this will happen at least once per vacuum, after the heap
- has been completely scanned. It may happen multiple times per vacuum
- if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
- <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
- the number of dead tuples found.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
- is distinct from scanning the heap, and occurs after each instance of
- vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
- <structfield>heap_blks_total</structfield>, the system will return to scanning
- the heap after this phase is completed; otherwise, it will begin
- cleaning up indexes after this phase is completed.
- </entry>
- </row>
- <row>
- <entry><literal>cleaning up indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently cleaning up indexes. This occurs after
- the heap has been completely scanned and all vacuuming of the indexes
- and the heap has been completed.
- </entry>
- </row>
- <row>
- <entry><literal>truncating heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently truncating the heap so as to return
- empty pages at the end of the relation to the operating system. This
- occurs after cleaning up indexes.
- </entry>
- </row>
- <row>
- <entry><literal>performing final cleanup</literal></entry>
- <entry>
- <command>VACUUM</command> is performing final cleanup. During this phase,
- <command>VACUUM</command> will vacuum the free space map, update statistics
- in <literal>pg_class</literal>, and report statistics to the cumulative
- statistics system. When this phase is completed, <command>VACUUM</command> will end.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- </sect2>
-
- <sect2 id="cluster-progress-reporting">
- <title>CLUSTER Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_cluster</primary>
- </indexterm>
-
- <para>
- Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
- running, the <structname>pg_stat_progress_cluster</structname> view will
- contain a row for each backend that is currently running either command.
- The tables below describe the information that will be reported and
- provide information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
- <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
+ <title><structname>pg_stat_progress_vacuum</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -6603,16 +6733,7 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>relid</structfield> <type>oid</type>
</para>
<para>
- OID of the table being clustered.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ OID of the table being vacuumed.
</para></entry>
</row>
@@ -6621,81 +6742,81 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>phase</structfield> <type>text</type>
</para>
<para>
- Current processing phase. See <xref linkend="cluster-phases"/>.
+ Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>cluster_index_relid</structfield> <type>oid</type>
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
</para>
<para>
- If the table is being scanned using an index, this is the OID of the
- index being used; otherwise, it is zero.
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of the scan; blocks added later will not be (and
+ need not be) visited by this <command>VACUUM</command>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples scanned.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks scanned. Because the
+ <link linkend="storage-vm">visibility map</link> is used to optimize scans,
+ some blocks will be skipped without inspection; skipped blocks are
+ included in this total, so that this number will eventually become
+ equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
+ This counter only advances when the phase is <literal>scanning heap</literal>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples written.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks vacuumed. Unless the table has no indexes, this
+ counter only advances when the phase is <literal>vacuuming heap</literal>.
+ Blocks that contain no dead tuples are skipped, so the counter may
+ sometimes skip forward in large increments.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
+ <structfield>index_vacuum_count</structfield> <type>bigint</type>
</para>
<para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of <literal>seq scanning heap</literal>.
+ Number of completed index vacuum cycles.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ <structfield>max_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of heap blocks scanned. This counter only advances when the
- phase is <literal>seq scanning heap</literal>.
+ Number of dead tuples that we can store before needing to perform
+ an index vacuum cycle, based on
+ <xref linkend="guc-maintenance-work-mem"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ <structfield>num_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of indexes rebuilt. This counter only advances when the phase
- is <literal>rebuilding index</literal>.
+ Number of dead tuples collected since the last index vacuum cycle.
</para></entry>
</row>
</tbody>
</tgroup>
</table>
- <table id="cluster-phases">
- <title>CLUSTER and VACUUM FULL Phases</title>
+ <table id="vacuum-phases">
+ <title>VACUUM Phases</title>
<tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="2*"/>
@@ -6710,57 +6831,70 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry><literal>initializing</literal></entry>
<entry>
- The command is preparing to begin scanning the heap. This phase is
- expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>seq scanning heap</literal></entry>
- <entry>
- The command is currently scanning the table using a sequential scan.
+ <command>VACUUM</command> is preparing to begin scanning the heap. This
+ phase is expected to be very brief.
</entry>
</row>
<row>
- <entry><literal>index scanning heap</literal></entry>
+ <entry><literal>scanning heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently scanning the table using an index scan.
+ <command>VACUUM</command> is currently scanning the heap. It will prune and
+ defragment each page if required, and possibly perform freezing
+ activity. The <structfield>heap_blks_scanned</structfield> column can be used
+ to monitor the progress of the scan.
</entry>
</row>
<row>
- <entry><literal>sorting tuples</literal></entry>
+ <entry><literal>vacuuming indexes</literal></entry>
<entry>
- <command>CLUSTER</command> is currently sorting tuples.
+ <command>VACUUM</command> is currently vacuuming the indexes. If a table has
+ any indexes, this will happen at least once per vacuum, after the heap
+ has been completely scanned. It may happen multiple times per vacuum
+ if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
+ <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
+ the number of dead tuples found.
</entry>
</row>
<row>
- <entry><literal>writing new heap</literal></entry>
+ <entry><literal>vacuuming heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently writing the new heap.
+ <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
+ is distinct from scanning the heap, and occurs after each instance of
+ vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
+ <structfield>heap_blks_total</structfield>, the system will return to scanning
+ the heap after this phase is completed; otherwise, it will begin
+ cleaning up indexes after this phase is completed.
</entry>
</row>
<row>
- <entry><literal>swapping relation files</literal></entry>
+ <entry><literal>cleaning up indexes</literal></entry>
<entry>
- The command is currently swapping newly-built files into place.
+ <command>VACUUM</command> is currently cleaning up indexes. This occurs after
+ the heap has been completely scanned and all vacuuming of the indexes
+ and the heap has been completed.
</entry>
</row>
<row>
- <entry><literal>rebuilding index</literal></entry>
+ <entry><literal>truncating heap</literal></entry>
<entry>
- The command is currently rebuilding an index.
+ <command>VACUUM</command> is currently truncating the heap so as to return
+ empty pages at the end of the relation to the operating system. This
+ occurs after cleaning up indexes.
</entry>
</row>
<row>
<entry><literal>performing final cleanup</literal></entry>
<entry>
- The command is performing final cleanup. When this phase is
- completed, <command>CLUSTER</command>
- or <command>VACUUM FULL</command> will end.
+ <command>VACUUM</command> is performing final cleanup. During this phase,
+ <command>VACUUM</command> will vacuum the free space map, update statistics
+ in <literal>pg_class</literal>, and report statistics to the cumulative
+ statistics system. When this phase is completed, <command>VACUUM</command> will end.
</entry>
</row>
</tbody>
</tgroup>
</table>
+
</sect2>
<sect2 id="basebackup-progress-reporting">
@@ -6938,140 +7072,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
</sect2>
- <sect2 id="copy-progress-reporting">
- <title>COPY Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_copy</primary>
- </indexterm>
-
- <para>
- Whenever <command>COPY</command> is running, the
- <structname>pg_stat_progress_copy</structname> view will contain one row
- for each backend that is currently running a <command>COPY</command> command.
- The table below describes the information that will be reported and provides
- information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
- <title><structname>pg_stat_progress_copy</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table on which the <command>COPY</command> command is
- executed. It is set to <literal>0</literal> if copying from a
- <command>SELECT</command> query.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running: <literal>COPY FROM</literal>, or
- <literal>COPY TO</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>type</structfield> <type>text</type>
- </para>
- <para>
- The io type that the data is read from or written to:
- <literal>FILE</literal>, <literal>PROGRAM</literal>,
- <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
- <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
- (used for example during the initial table synchronization in
- logical replication).
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of bytes already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_total</structfield> <type>bigint</type>
- </para>
- <para>
- Size of source file for <command>COPY FROM</command> command in bytes.
- It is set to <literal>0</literal> if not available.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_excluded</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples not processed because they were excluded by the
- <command>WHERE</command> clause of the <command>COPY</command> command.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
</sect1>
<sect1 id="dynamic-trace">
--
1.8.3.1
v5-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patchapplication/octet-stream; name=v5-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patchDownload
From 19935452bea39bd0508c9a243c296623debf38e5 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 16 Nov 2022 11:13:18 +1100
Subject: [PATCH v5] Re-order Table 28.12 "Wait Events of type LWLock"
---
doc/src/sgml/monitoring.sgml | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c472a31..b80297f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2072,6 +2072,18 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transaction during a parallel query.</entry>
</row>
<row>
+ <entry><literal>PgStatsData</literal></entry>
+ <entry>Waiting for shared memory stats data access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsDSA</literal></entry>
+ <entry>Waiting for stats dynamic shared memory allocator access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsHash</literal></entry>
+ <entry>Waiting for stats shared memory hash table access</entry>
+ </row>
+ <row>
<entry><literal>PredicateLockManager</literal></entry>
<entry>Waiting to access predicate lock information used by
serializable transactions.</entry>
@@ -2130,18 +2142,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transactions.</entry>
</row>
<row>
- <entry><literal>PgStatsDSA</literal></entry>
- <entry>Waiting for stats dynamic shared memory allocator access</entry>
- </row>
- <row>
- <entry><literal>PgStatsHash</literal></entry>
- <entry>Waiting for stats shared memory hash table access</entry>
- </row>
- <row>
- <entry><literal>PgStatsData</literal></entry>
- <entry>Waiting for shared memory stats data access</entry>
- </row>
- <row>
<entry><literal>SerializableXactHash</literal></entry>
<entry>Waiting to read or update information about serializable
transactions.</entry>
--
1.8.3.1
On Tue, Nov 15, 2022 at 6:39 PM Peter Smith <smithpb2250@gmail.com> wrote:
I was also wondering (but have not yet done) if the content *outside*
the tables should be reordered to match the table 28.1/28.2 order.Thoughts?
I would love to do away with the ToC listing of view names in 28.2
altogether.
Also, make it so each view ends up being its own separate page.
The name of the views in the table should then be the hyperlinks to those
pages.
Basically the way Chapter 54.1 works. Though the interplay between the top
Chapter 54 and 54.1 is a bit repetitive.
https://www.postgresql.org/docs/current/views.html
I wonder whether having the table be structured but the ToC be purely
alphabetical would be considered a good idea...
The tables need hyperlinks regardless. I wouldn't insist on changing the
ordering to match the table, especially with the hyperlinks, but I also
wouldn't reject it. Figuring out how to make them one-per-page would be
time better spent though.
David J.
On Thu, Nov 17, 2022 at 8:46 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:
On Tue, Nov 15, 2022 at 6:39 PM Peter Smith <smithpb2250@gmail.com> wrote:
I was also wondering (but have not yet done) if the content *outside*
the tables should be reordered to match the table 28.1/28.2 order.Thoughts?
Thanks for the feedback/suggestions
I would love to do away with the ToC listing of view names in 28.2 altogether.
OK, done. See patch 0006. To prevent all the views sections from
participating in the ToC I simply changed them to <sect3> instead of
<sect2>. I’m not 100% sure if this was a brilliant modification or a
total hack, but it does do exactly what you wanted.
Also, make it so each view ends up being its own separate page.
I did not do this. AFAIK those views of chapter 54 get rendered to
separate pages only because they are top-level <sect1>. So I do not
know how to put all these stats views onto different pages without
radically changing the document structure. Anyway – doing this would
be incompatible with my <sect3> changes of patch 0006 (see above).
The name of the views in the table should then be the hyperlinks to those pages.
OK done. See patch 0005. All the view names (in column one of the
tables) are hyperlinked to the views the same way as Chapter 54 does.
The tables are a lot cleaner now. A couple of inconsistent view ids
were also corrected.
Basically the way Chapter 54.1 works. Though the interplay between the top Chapter 54 and 54.1 is a bit repetitive.
https://www.postgresql.org/docs/current/views.html
I wonder whether having the table be structured but the ToC be purely alphabetical would be considered a good idea...
The tables need hyperlinks regardless. I wouldn't insist on changing the ordering to match the table, especially with the hyperlinks, but I also wouldn't reject it. Figuring out how to make them one-per-page would be time better spent though.
PSA new patches. Now there are 6 of them. If some of the earlier
patches are agreeable can those ones please be committed? (because I
think this patch may be susceptible to needing a big rebase if
anything in those tables changes).
------
Kind Regards,
Peter Smith.
Fujitsu Australia.
Attachments:
v6-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patchapplication/octet-stream; name=v6-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patchDownload
From 48837576ef9e68d066fffcc0769cf6d6fa5c54a8 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 16:31:30 +1100
Subject: [PATCH v6] Re-order Table 28.35 "Per-Backend Statistics Functions"
---
doc/src/sgml/monitoring.sgml | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index b80297f..2f10413 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5564,19 +5564,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_idset</primary>
- </indexterm>
- <function>pg_stat_get_backend_idset</function> ()
- <returnvalue>setof integer</returnvalue>
- </para>
- <para>
- Returns the set of currently active backend ID numbers.
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>pg_stat_get_backend_activity</primary>
</indexterm>
<function>pg_stat_get_backend_activity</function> ( <type>integer</type> )
@@ -5642,6 +5629,19 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>pg_stat_get_backend_idset</primary>
+ </indexterm>
+ <function>pg_stat_get_backend_idset</function> ()
+ <returnvalue>setof integer</returnvalue>
+ </para>
+ <para>
+ Returns the set of currently active backend ID numbers.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>pg_stat_get_backend_pid</primary>
</indexterm>
<function>pg_stat_get_backend_pid</function> ( <type>integer</type> )
@@ -5681,29 +5681,29 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event_type</primary>
+ <primary>pg_stat_get_backend_wait_event</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event type name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-table"/> for details.
+ Returns the wait event name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
+ <xref linkend="wait-event-timeout-table"/>.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_stat_get_backend_wait_event</primary>
+ <primary>pg_stat_get_backend_wait_event_type</primary>
</indexterm>
- <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
+ <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the wait event name if this backend is currently waiting,
- otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
- <xref linkend="wait-event-timeout-table"/>.
+ Returns the wait event type name if this backend is currently waiting,
+ otherwise NULL. See <xref linkend="wait-event-table"/> for details.
</para></entry>
</row>
--
1.8.3.1
v6-0006-Remove-all-stats-views-from-the-ToC-of-28.2.patchapplication/octet-stream; name=v6-0006-Remove-all-stats-views-from-the-ToC-of-28.2.patchDownload
From 7ee858e2af3b75464bdc44915b691b2c8fe60f85 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 19:01:35 +1100
Subject: [PATCH v6] Remove all stats views from the ToC of 28.2.
This was done by changing all the stats view to have <sect3> instead of <sect2>.
---
doc/src/sgml/monitoring.sgml | 86 ++++++++++++++++++++++----------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 333fe78..7909741 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -746,9 +746,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
into the kernel's handling of I/O.
</para>
- </sect2>
-
- <sect2 id="monitoring-pg-stat-activity-view">
+ <sect3 id="monitoring-pg-stat-activity-view">
<title><structname>pg_stat_activity</structname></title>
<indexterm>
@@ -2387,9 +2385,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</programlisting>
</para>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-replication-view">
+ <sect3 id="monitoring-pg-stat-replication-view">
<title><structname>pg_stat_replication</structname></title>
<indexterm>
@@ -2724,9 +2722,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
+ <sect3 id="monitoring-pg-stat-replication-slots-view">
<title><structname>pg_stat_replication_slots</structname></title>
<indexterm>
@@ -2873,9 +2871,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
+ <sect3 id="monitoring-pg-stat-wal-receiver-view">
<title><structname>pg_stat_wal_receiver</structname></title>
<indexterm>
@@ -3053,9 +3051,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
+ <sect3 id="monitoring-pg-stat-recovery-prefetch">
<title><structname>pg_stat_recovery_prefetch</structname></title>
<indexterm>
@@ -3199,9 +3197,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-subscription">
+ <sect3 id="monitoring-pg-stat-subscription">
<title><structname>pg_stat_subscription</structname></title>
<indexterm>
@@ -3310,9 +3308,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-subscription-stats">
+ <sect3 id="monitoring-pg-stat-subscription-stats">
<title><structname>pg_stat_subscription_stats</structname></title>
<indexterm>
@@ -3388,9 +3386,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-ssl-view">
+ <sect3 id="monitoring-pg-stat-ssl-view">
<title><structname>pg_stat_ssl</structname></title>
<indexterm>
@@ -3509,9 +3507,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-gssapi-view">
+ <sect3 id="monitoring-pg-stat-gssapi-view">
<title><structname>pg_stat_gssapi</structname></title>
<indexterm>
@@ -3584,9 +3582,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-archiver-view">
+ <sect3 id="monitoring-pg-stat-archiver-view">
<title><structname>pg_stat_archiver</structname></title>
<indexterm>
@@ -3688,9 +3686,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
archived.
</para>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-bgwriter-view">
+ <sect3 id="monitoring-pg-stat-bgwriter-view">
<title><structname>pg_stat_bgwriter</structname></title>
<indexterm>
@@ -3825,9 +3823,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-wal-view">
+ <sect3 id="monitoring-pg-stat-wal-view">
<title><structname>pg_stat_wal</structname></title>
<indexterm>
@@ -3959,9 +3957,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
-</sect2>
+</sect3>
- <sect2 id="monitoring-pg-stat-database-view">
+ <sect3 id="monitoring-pg-stat-database-view">
<title><structname>pg_stat_database</structname></title>
<indexterm>
@@ -4284,9 +4282,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
+ <sect3 id="monitoring-pg-stat-database-conflicts-view">
<title><structname>pg_stat_database_conflicts</structname></title>
<indexterm>
@@ -4387,9 +4385,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-all-tables-view">
+ <sect3 id="monitoring-pg-stat-all-tables-view">
<title><structname>pg_stat_all_tables</structname></title>
<indexterm>
@@ -4658,9 +4656,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-all-indexes-view">
+ <sect3 id="monitoring-pg-stat-all-indexes-view">
<title><structname>pg_stat_all_indexes</structname></title>
<indexterm>
@@ -4807,9 +4805,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-tables-view">
+ <sect3 id="monitoring-pg-statio-all-tables-view">
<title><structname>pg_statio_all_tables</structname></title>
<indexterm>
@@ -4943,9 +4941,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-indexes-view">
+ <sect3 id="monitoring-pg-statio-all-indexes-view">
<title><structname>pg_statio_all_indexes</structname></title>
<indexterm>
@@ -5043,9 +5041,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-sequences-view">
+ <sect3 id="monitoring-pg-statio-all-sequences-view">
<title><structname>pg_statio_all_sequences</structname></title>
<indexterm>
@@ -5121,9 +5119,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-user-functions-view">
+ <sect3 id="monitoring-pg-stat-user-functions-view">
<title><structname>pg_stat_user_functions</structname></title>
<indexterm>
@@ -5211,9 +5209,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-slru-view">
+ <sect3 id="monitoring-pg-stat-slru-view">
<title><structname>pg_stat_slru</structname></title>
<indexterm>
@@ -5333,6 +5331,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
+ </sect3>
+
</sect2>
<sect2 id="monitoring-stats-functions">
--
1.8.3.1
v6-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchapplication/octet-stream; name=v6-0001-Re-order-sections-of-28.4.-Progress-Reporting.patchDownload
From 7692757a1eac19d24e8dcfa5ec9e98b48eb17df4 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 16:28:38 +1100
Subject: [PATCH v6] Re-order sections of "28.4. Progress Reporting"
BEFORE
28.4.1. ANALYZE Progress Reporting
28.4.2. CREATE INDEX Progress Reporting
28.4.3. VACUUM Progress Reporting
28.4.4. CLUSTER Progress Reporting
28.4.5. Base Backup Progress Reporting
28.4.6. COPY Progress Reporting
AFTER
28.4.1. ANALYZE Progress Reporting
28.4.2. CLUSTER Progress Reporting
28.4.3. COPY Progress Reporting
28.4.4. CREATE INDEX Progress Reporting
28.4.5. VACUUM Progress Reporting
28.4.6. Base Backup Progress Reporting
---
doc/src/sgml/monitoring.sgml | 840 +++++++++++++++++++++----------------------
1 file changed, 420 insertions(+), 420 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index e5d622d..31f457e 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6008,6 +6008,362 @@ FROM pg_stat_get_backend_idset() AS backendid;
</note>
</sect2>
+ <sect2 id="cluster-progress-reporting">
+ <title>CLUSTER Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_cluster</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
+ running, the <structname>pg_stat_progress_cluster</structname> view will
+ contain a row for each backend that is currently running either command.
+ The tables below describe the information that will be reported and
+ provide information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
+ <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table being clustered.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>phase</structfield> <type>text</type>
+ </para>
+ <para>
+ Current processing phase. See <xref linkend="cluster-phases"/>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>cluster_index_relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ If the table is being scanned using an index, this is the OID of the
+ index being used; otherwise, it is zero.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples scanned.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap tuples written.
+ This counter only advances when the phase is
+ <literal>seq scanning heap</literal>,
+ <literal>index scanning heap</literal>
+ or <literal>writing new heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of heap blocks scanned. This counter only advances when the
+ phase is <literal>seq scanning heap</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of indexes rebuilt. This counter only advances when the phase
+ is <literal>rebuilding index</literal>.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="cluster-phases">
+ <title>CLUSTER and VACUUM FULL Phases</title>
+ <tgroup cols="2">
+ <colspec colname="col1" colwidth="1*"/>
+ <colspec colname="col2" colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Phase</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>initializing</literal></entry>
+ <entry>
+ The command is preparing to begin scanning the heap. This phase is
+ expected to be very brief.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>seq scanning heap</literal></entry>
+ <entry>
+ The command is currently scanning the table using a sequential scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>index scanning heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently scanning the table using an index scan.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>sorting tuples</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently sorting tuples.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>writing new heap</literal></entry>
+ <entry>
+ <command>CLUSTER</command> is currently writing the new heap.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>swapping relation files</literal></entry>
+ <entry>
+ The command is currently swapping newly-built files into place.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>rebuilding index</literal></entry>
+ <entry>
+ The command is currently rebuilding an index.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>performing final cleanup</literal></entry>
+ <entry>
+ The command is performing final cleanup. When this phase is
+ completed, <command>CLUSTER</command>
+ or <command>VACUUM FULL</command> will end.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="copy-progress-reporting">
+ <title>COPY Progress Reporting</title>
+
+ <indexterm>
+ <primary>pg_stat_progress_copy</primary>
+ </indexterm>
+
+ <para>
+ Whenever <command>COPY</command> is running, the
+ <structname>pg_stat_progress_copy</structname> view will contain one row
+ for each backend that is currently running a <command>COPY</command> command.
+ The table below describes the information that will be reported and provides
+ information about how to interpret it.
+ </para>
+
+ <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
+ <title><structname>pg_stat_progress_copy</structname> View</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ Column Type
+ </para>
+ <para>
+ Description
+ </para></entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pid</structfield> <type>integer</type>
+ </para>
+ <para>
+ Process ID of backend.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>datname</structfield> <type>name</type>
+ </para>
+ <para>
+ Name of the database to which this backend is connected.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>relid</structfield> <type>oid</type>
+ </para>
+ <para>
+ OID of the table on which the <command>COPY</command> command is
+ executed. It is set to <literal>0</literal> if copying from a
+ <command>SELECT</command> query.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>command</structfield> <type>text</type>
+ </para>
+ <para>
+ The command that is running: <literal>COPY FROM</literal>, or
+ <literal>COPY TO</literal>.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>type</structfield> <type>text</type>
+ </para>
+ <para>
+ The io type that the data is read from or written to:
+ <literal>FILE</literal>, <literal>PROGRAM</literal>,
+ <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
+ <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
+ (used for example during the initial table synchronization in
+ logical replication).
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of bytes already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>bytes_total</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Size of source file for <command>COPY FROM</command> command in bytes.
+ It is set to <literal>0</literal> if not available.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_processed</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples already processed by <command>COPY</command> command.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>tuples_excluded</structfield> <type>bigint</type>
+ </para>
+ <para>
+ Number of tuples not processed because they were excluded by the
+ <command>WHERE</command> clause of the <command>COPY</command> command.
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
<sect2 id="create-index-progress-reporting">
<title>CREATE INDEX Progress Reporting</title>
@@ -6330,234 +6686,8 @@ FROM pg_stat_get_backend_idset() AS backendid;
in place. See <xref linkend='cluster-progress-reporting'/>.
</para>
- <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
- <title><structname>pg_stat_progress_vacuum</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table being vacuumed.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>phase</structfield> <type>text</type>
- </para>
- <para>
- Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
- </para>
- <para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of the scan; blocks added later will not be (and
- need not be) visited by this <command>VACUUM</command>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks scanned. Because the
- <link linkend="storage-vm">visibility map</link> is used to optimize scans,
- some blocks will be skipped without inspection; skipped blocks are
- included in this total, so that this number will eventually become
- equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
- This counter only advances when the phase is <literal>scanning heap</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of heap blocks vacuumed. Unless the table has no indexes, this
- counter only advances when the phase is <literal>vacuuming heap</literal>.
- Blocks that contain no dead tuples are skipped, so the counter may
- sometimes skip forward in large increments.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_vacuum_count</structfield> <type>bigint</type>
- </para>
- <para>
- Number of completed index vacuum cycles.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>max_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples that we can store before needing to perform
- an index vacuum cycle, based on
- <xref linkend="guc-maintenance-work-mem"/>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>num_dead_tuples</structfield> <type>bigint</type>
- </para>
- <para>
- Number of dead tuples collected since the last index vacuum cycle.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="vacuum-phases">
- <title>VACUUM Phases</title>
- <tgroup cols="2">
- <colspec colname="col1" colwidth="1*"/>
- <colspec colname="col2" colwidth="2*"/>
- <thead>
- <row>
- <entry>Phase</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>initializing</literal></entry>
- <entry>
- <command>VACUUM</command> is preparing to begin scanning the heap. This
- phase is expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>scanning heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently scanning the heap. It will prune and
- defragment each page if required, and possibly perform freezing
- activity. The <structfield>heap_blks_scanned</structfield> column can be used
- to monitor the progress of the scan.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the indexes. If a table has
- any indexes, this will happen at least once per vacuum, after the heap
- has been completely scanned. It may happen multiple times per vacuum
- if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
- <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
- the number of dead tuples found.
- </entry>
- </row>
- <row>
- <entry><literal>vacuuming heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
- is distinct from scanning the heap, and occurs after each instance of
- vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
- <structfield>heap_blks_total</structfield>, the system will return to scanning
- the heap after this phase is completed; otherwise, it will begin
- cleaning up indexes after this phase is completed.
- </entry>
- </row>
- <row>
- <entry><literal>cleaning up indexes</literal></entry>
- <entry>
- <command>VACUUM</command> is currently cleaning up indexes. This occurs after
- the heap has been completely scanned and all vacuuming of the indexes
- and the heap has been completed.
- </entry>
- </row>
- <row>
- <entry><literal>truncating heap</literal></entry>
- <entry>
- <command>VACUUM</command> is currently truncating the heap so as to return
- empty pages at the end of the relation to the operating system. This
- occurs after cleaning up indexes.
- </entry>
- </row>
- <row>
- <entry><literal>performing final cleanup</literal></entry>
- <entry>
- <command>VACUUM</command> is performing final cleanup. During this phase,
- <command>VACUUM</command> will vacuum the free space map, update statistics
- in <literal>pg_class</literal>, and report statistics to the cumulative
- statistics system. When this phase is completed, <command>VACUUM</command> will end.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- </sect2>
-
- <sect2 id="cluster-progress-reporting">
- <title>CLUSTER Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_cluster</primary>
- </indexterm>
-
- <para>
- Whenever <command>CLUSTER</command> or <command>VACUUM FULL</command> is
- running, the <structname>pg_stat_progress_cluster</structname> view will
- contain a row for each backend that is currently running either command.
- The tables below describe the information that will be reported and
- provide information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-cluster-view" xreflabel="pg_stat_progress_cluster">
- <title><structname>pg_stat_progress_cluster</structname> View</title>
+ <table id="pg-stat-progress-vacuum-view" xreflabel="pg_stat_progress_vacuum">
+ <title><structname>pg_stat_progress_vacuum</structname> View</title>
<tgroup cols="1">
<thead>
<row>
@@ -6603,16 +6733,7 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>relid</structfield> <type>oid</type>
</para>
<para>
- OID of the table being clustered.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running. Either <literal>CLUSTER</literal> or <literal>VACUUM FULL</literal>.
+ OID of the table being vacuumed.
</para></entry>
</row>
@@ -6621,81 +6742,81 @@ FROM pg_stat_get_backend_idset() AS backendid;
<structfield>phase</structfield> <type>text</type>
</para>
<para>
- Current processing phase. See <xref linkend="cluster-phases"/>.
+ Current processing phase of vacuum. See <xref linkend="vacuum-phases"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>cluster_index_relid</structfield> <type>oid</type>
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
</para>
<para>
- If the table is being scanned using an index, this is the OID of the
- index being used; otherwise, it is zero.
+ Total number of heap blocks in the table. This number is reported
+ as of the beginning of the scan; blocks added later will not be (and
+ need not be) visited by this <command>VACUUM</command>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples scanned.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks scanned. Because the
+ <link linkend="storage-vm">visibility map</link> is used to optimize scans,
+ some blocks will be skipped without inspection; skipped blocks are
+ included in this total, so that this number will eventually become
+ equal to <structfield>heap_blks_total</structfield> when the vacuum is complete.
+ This counter only advances when the phase is <literal>scanning heap</literal>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_tuples_written</structfield> <type>bigint</type>
+ <structfield>heap_blks_vacuumed</structfield> <type>bigint</type>
</para>
<para>
- Number of heap tuples written.
- This counter only advances when the phase is
- <literal>seq scanning heap</literal>,
- <literal>index scanning heap</literal>
- or <literal>writing new heap</literal>.
+ Number of heap blocks vacuumed. Unless the table has no indexes, this
+ counter only advances when the phase is <literal>vacuuming heap</literal>.
+ Blocks that contain no dead tuples are skipped, so the counter may
+ sometimes skip forward in large increments.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_total</structfield> <type>bigint</type>
+ <structfield>index_vacuum_count</structfield> <type>bigint</type>
</para>
<para>
- Total number of heap blocks in the table. This number is reported
- as of the beginning of <literal>seq scanning heap</literal>.
+ Number of completed index vacuum cycles.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>heap_blks_scanned</structfield> <type>bigint</type>
+ <structfield>max_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of heap blocks scanned. This counter only advances when the
- phase is <literal>seq scanning heap</literal>.
+ Number of dead tuples that we can store before needing to perform
+ an index vacuum cycle, based on
+ <xref linkend="guc-maintenance-work-mem"/>.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>index_rebuild_count</structfield> <type>bigint</type>
+ <structfield>num_dead_tuples</structfield> <type>bigint</type>
</para>
<para>
- Number of indexes rebuilt. This counter only advances when the phase
- is <literal>rebuilding index</literal>.
+ Number of dead tuples collected since the last index vacuum cycle.
</para></entry>
</row>
</tbody>
</tgroup>
</table>
- <table id="cluster-phases">
- <title>CLUSTER and VACUUM FULL Phases</title>
+ <table id="vacuum-phases">
+ <title>VACUUM Phases</title>
<tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="2*"/>
@@ -6710,57 +6831,70 @@ FROM pg_stat_get_backend_idset() AS backendid;
<row>
<entry><literal>initializing</literal></entry>
<entry>
- The command is preparing to begin scanning the heap. This phase is
- expected to be very brief.
- </entry>
- </row>
- <row>
- <entry><literal>seq scanning heap</literal></entry>
- <entry>
- The command is currently scanning the table using a sequential scan.
+ <command>VACUUM</command> is preparing to begin scanning the heap. This
+ phase is expected to be very brief.
</entry>
</row>
<row>
- <entry><literal>index scanning heap</literal></entry>
+ <entry><literal>scanning heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently scanning the table using an index scan.
+ <command>VACUUM</command> is currently scanning the heap. It will prune and
+ defragment each page if required, and possibly perform freezing
+ activity. The <structfield>heap_blks_scanned</structfield> column can be used
+ to monitor the progress of the scan.
</entry>
</row>
<row>
- <entry><literal>sorting tuples</literal></entry>
+ <entry><literal>vacuuming indexes</literal></entry>
<entry>
- <command>CLUSTER</command> is currently sorting tuples.
+ <command>VACUUM</command> is currently vacuuming the indexes. If a table has
+ any indexes, this will happen at least once per vacuum, after the heap
+ has been completely scanned. It may happen multiple times per vacuum
+ if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
+ <xref linkend="guc-autovacuum-work-mem"/> if set) is insufficient to store
+ the number of dead tuples found.
</entry>
</row>
<row>
- <entry><literal>writing new heap</literal></entry>
+ <entry><literal>vacuuming heap</literal></entry>
<entry>
- <command>CLUSTER</command> is currently writing the new heap.
+ <command>VACUUM</command> is currently vacuuming the heap. Vacuuming the heap
+ is distinct from scanning the heap, and occurs after each instance of
+ vacuuming indexes. If <structfield>heap_blks_scanned</structfield> is less than
+ <structfield>heap_blks_total</structfield>, the system will return to scanning
+ the heap after this phase is completed; otherwise, it will begin
+ cleaning up indexes after this phase is completed.
</entry>
</row>
<row>
- <entry><literal>swapping relation files</literal></entry>
+ <entry><literal>cleaning up indexes</literal></entry>
<entry>
- The command is currently swapping newly-built files into place.
+ <command>VACUUM</command> is currently cleaning up indexes. This occurs after
+ the heap has been completely scanned and all vacuuming of the indexes
+ and the heap has been completed.
</entry>
</row>
<row>
- <entry><literal>rebuilding index</literal></entry>
+ <entry><literal>truncating heap</literal></entry>
<entry>
- The command is currently rebuilding an index.
+ <command>VACUUM</command> is currently truncating the heap so as to return
+ empty pages at the end of the relation to the operating system. This
+ occurs after cleaning up indexes.
</entry>
</row>
<row>
<entry><literal>performing final cleanup</literal></entry>
<entry>
- The command is performing final cleanup. When this phase is
- completed, <command>CLUSTER</command>
- or <command>VACUUM FULL</command> will end.
+ <command>VACUUM</command> is performing final cleanup. During this phase,
+ <command>VACUUM</command> will vacuum the free space map, update statistics
+ in <literal>pg_class</literal>, and report statistics to the cumulative
+ statistics system. When this phase is completed, <command>VACUUM</command> will end.
</entry>
</row>
</tbody>
</tgroup>
</table>
+
</sect2>
<sect2 id="basebackup-progress-reporting">
@@ -6938,140 +7072,6 @@ FROM pg_stat_get_backend_idset() AS backendid;
</sect2>
- <sect2 id="copy-progress-reporting">
- <title>COPY Progress Reporting</title>
-
- <indexterm>
- <primary>pg_stat_progress_copy</primary>
- </indexterm>
-
- <para>
- Whenever <command>COPY</command> is running, the
- <structname>pg_stat_progress_copy</structname> view will contain one row
- for each backend that is currently running a <command>COPY</command> command.
- The table below describes the information that will be reported and provides
- information about how to interpret it.
- </para>
-
- <table id="pg-stat-progress-copy-view" xreflabel="pg_stat_progress_copy">
- <title><structname>pg_stat_progress_copy</structname> View</title>
- <tgroup cols="1">
- <thead>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- Column Type
- </para>
- <para>
- Description
- </para></entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>pid</structfield> <type>integer</type>
- </para>
- <para>
- Process ID of backend.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>datname</structfield> <type>name</type>
- </para>
- <para>
- Name of the database to which this backend is connected.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>relid</structfield> <type>oid</type>
- </para>
- <para>
- OID of the table on which the <command>COPY</command> command is
- executed. It is set to <literal>0</literal> if copying from a
- <command>SELECT</command> query.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>command</structfield> <type>text</type>
- </para>
- <para>
- The command that is running: <literal>COPY FROM</literal>, or
- <literal>COPY TO</literal>.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>type</structfield> <type>text</type>
- </para>
- <para>
- The io type that the data is read from or written to:
- <literal>FILE</literal>, <literal>PROGRAM</literal>,
- <literal>PIPE</literal> (for <command>COPY FROM STDIN</command> and
- <command>COPY TO STDOUT</command>), or <literal>CALLBACK</literal>
- (used for example during the initial table synchronization in
- logical replication).
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of bytes already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>bytes_total</structfield> <type>bigint</type>
- </para>
- <para>
- Size of source file for <command>COPY FROM</command> command in bytes.
- It is set to <literal>0</literal> if not available.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_processed</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples already processed by <command>COPY</command> command.
- </para></entry>
- </row>
-
- <row>
- <entry role="catalog_table_entry"><para role="column_definition">
- <structfield>tuples_excluded</structfield> <type>bigint</type>
- </para>
- <para>
- Number of tuples not processed because they were excluded by the
- <command>WHERE</command> clause of the <command>COPY</command> command.
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
</sect1>
<sect1 id="dynamic-trace">
--
1.8.3.1
v6-0002-Re-order-Table-28.2-Collected-Statistics-Views.patchapplication/octet-stream; name=v6-0002-Re-order-Table-28.2-Collected-Statistics-Views.patchDownload
From 1981597fa97b043756346ce148e86a47af92f30b Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 16:29:45 +1100
Subject: [PATCH v6] Re-order Table 28.2 "Collected Statistics Views"
---
doc/src/sgml/monitoring.sgml | 78 ++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 31f457e..c472a31 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -475,6 +475,23 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -497,6 +514,28 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
@@ -540,28 +579,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
<entry>
One row for each index in the current database,
@@ -624,23 +641,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
<entry>One row per subscription, showing statistics about errors.
See <link linkend="monitoring-pg-stat-subscription-stats">
--
1.8.3.1
v6-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patchapplication/octet-stream; name=v6-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patchDownload
From aa4e309cb47999c9b1bd300f2688b6fb8d67aac3 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 16:30:38 +1100
Subject: [PATCH v6] Re-order Table 28.12 "Wait Events of type LWLock"
---
doc/src/sgml/monitoring.sgml | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c472a31..b80297f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2072,6 +2072,18 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transaction during a parallel query.</entry>
</row>
<row>
+ <entry><literal>PgStatsData</literal></entry>
+ <entry>Waiting for shared memory stats data access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsDSA</literal></entry>
+ <entry>Waiting for stats dynamic shared memory allocator access</entry>
+ </row>
+ <row>
+ <entry><literal>PgStatsHash</literal></entry>
+ <entry>Waiting for stats shared memory hash table access</entry>
+ </row>
+ <row>
<entry><literal>PredicateLockManager</literal></entry>
<entry>Waiting to access predicate lock information used by
serializable transactions.</entry>
@@ -2130,18 +2142,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
serializable transactions.</entry>
</row>
<row>
- <entry><literal>PgStatsDSA</literal></entry>
- <entry>Waiting for stats dynamic shared memory allocator access</entry>
- </row>
- <row>
- <entry><literal>PgStatsHash</literal></entry>
- <entry>Waiting for stats shared memory hash table access</entry>
- </row>
- <row>
- <entry><literal>PgStatsData</literal></entry>
- <entry>Waiting for shared memory stats data access</entry>
- </row>
- <row>
<entry><literal>SerializableXactHash</literal></entry>
<entry>Waiting to read or update information about serializable
transactions.</entry>
--
1.8.3.1
v6-0005-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchapplication/octet-stream; name=v6-0005-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchDownload
From 81afdfb06eee17468e4e59607400711d33d2b57d Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 23 Nov 2022 18:16:04 +1100
Subject: [PATCH v6] Cleanup view name hyperlinks for Tables 28.1 and 28.2
---
doc/src/sgml/monitoring.sgml | 256 +++++++++++++++++++++++++++----------------
1 file changed, 164 insertions(+), 92 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2f10413..333fe78 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -304,114 +304,130 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
<entry>
- <structname>pg_stat_activity</structname>
+ <link linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
<indexterm><primary>pg_stat_activity</primary></indexterm>
</entry>
<entry>
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See <link linkend="monitoring-pg-stat-activity-view">
- <structname>pg_stat_activity</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-view"><structname>pg_stat_replication</structname></link>
+ <indexterm><primary>pg_stat_replication</primary></indexterm>
+ </entry>
<entry>One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-receiver-view"><structname>pg_stat_wal_receiver</structname></link>
+ <indexterm><primary>pg_stat_wal_receiver</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-recovery-prefetch-view"><structname>pg_stat_recovery_prefetch</structname></link>
+ <indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-view"><structname>pg_stat_subscription</structname></link>
+ <indexterm><primary>pg_stat_subscription</primary></indexterm>
+ </entry>
<entry>At least one row per subscription, showing information about
the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-ssl-view"><structname>pg_stat_ssl</structname></link>
+ <indexterm><primary>pg_stat_ssl</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-gssapi-view"><structname>pg_stat_gssapi</structname></link>
+ <indexterm><primary>pg_stat_gssapi</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-analyze-view"><structname>pg_stat_progress_analyze</structname></link>
+ <indexterm><primary>pg_stat_progress_analyze</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_create_index</structname><indexterm><primary>pg_stat_progress_create_index</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-create-index-view"><structname>pg_stat_progress_create_index</structname></link>
+ <indexterm><primary>pg_stat_progress_create_index</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>CREATE INDEX</command> or <command>REINDEX</command>, showing
current progress.
- See <xref linkend='create-index-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_vacuum</structname><indexterm><primary>pg_stat_progress_vacuum</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-vacuum-view"><structname>pg_stat_progress_vacuum</structname></link>
+ <indexterm><primary>pg_stat_progress_vacuum</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>VACUUM</command>, showing current progress.
- See <xref linkend='vacuum-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-cluster-view"><structname>pg_stat_progress_cluster</structname></link>
+ <indexterm><primary>pg_stat_progress_cluster</primary></indexterm>
+ </entry>
<entry>One row for each backend running
<command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-basebackup-view"><structname>pg_stat_progress_basebackup</structname></link>
+ <indexterm><primary>pg_stat_progress_basebackup</primary></indexterm>
+ </entry>
<entry>One row for each WAL sender process streaming a base backup,
showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-copy-view"><structname>pg_stat_progress_copy</structname></link>
+ <indexterm><primary>pg_stat_progress_copy</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
</tbody>
@@ -431,112 +447,136 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
- <entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-archiver-view"><structname>pg_stat_archiver</structname></link>
+ <indexterm><primary>pg_stat_archiver</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
- <link linkend="monitoring-pg-stat-archiver-view">
- <structname>pg_stat_archiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_bgwriter</structname><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-bgwriter-view"><structname>pg_stat_bgwriter</structname></link>
+ <indexterm><primary>pg_stat_bgwriter</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
background writer process's activity. See
- <link linkend="monitoring-pg-stat-bgwriter-view">
- <structname>pg_stat_bgwriter</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-view"><structname>pg_stat_wal</structname></link>
+ <indexterm><primary>pg_stat_wal</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-view"><structname>pg_stat_database</structname></link>
+ <indexterm><primary>pg_stat_database</primary></indexterm>
+ </entry>
<entry>One row per database, showing database-wide statistics. See
- <link linkend="monitoring-pg-stat-database-view">
- <structname>pg_stat_database</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database_conflicts</structname><indexterm><primary>pg_stat_database_conflicts</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-conflicts-view"><structname>pg_stat_database_conflicts</structname></link>
+ <indexterm><primary>pg_stat_database_conflicts</primary></indexterm>
+ </entry>
<entry>
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See <link linkend="monitoring-pg-stat-database-conflicts-view">
- <structname>pg_stat_database_conflicts</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-slru-view"><structname>pg_stat_slru</structname></link>
+ <indexterm><primary>pg_stat_slru</primary></indexterm>
+ </entry>
<entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-slots-view"><structname>pg_stat_replication_slots</structname></link>
+ <indexterm><primary>pg_stat_replication_slots</primary></indexterm>
+ </entry>
<entry>One row per replication slot, showing statistics about the
replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_all_tables</structname></link>
+ <indexterm><primary>pg_stat_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_tables</structname>
+ <indexterm><primary>pg_stat_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_tables</structname>
+ <indexterm><primary>pg_stat_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_all_tables</structname></link>
+ <indexterm><primary>pg_statio_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_tables</structname>
+ <indexterm><primary>pg_statio_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_tables</structname>
+ <indexterm><primary>pg_statio_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_all_tables</structname>
+ <indexterm><primary>pg_stat_xact_all_tables</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_all_tables</structname> and related views).
@@ -545,106 +585,138 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_sys_tables</structname>
+ <indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_tables</structname>
+ <indexterm><primary>pg_stat_xact_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_all_indexes</structname></link>
+ <indexterm><primary>pg_stat_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_indexes</structname>
+ <indexterm><primary>pg_stat_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_indexes</structname>
+ <indexterm><primary>pg_stat_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_all_indexes</structname></link>
+ <indexterm><primary>pg_statio_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See <link linkend="monitoring-pg-statio-all-indexes-view">
- <structname>pg_statio_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_indexes</structname>
+ <indexterm><primary>pg_statio_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_indexes</structname>
+ <indexterm><primary>pg_statio_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_all_sequences</structname></link>
+ <indexterm><primary>pg_statio_all_sequences</primary></indexterm>
+ </entry>
<entry>
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See <link linkend="monitoring-pg-statio-all-sequences-view">
- <structname>pg_statio_all_sequences</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_sequences</structname>
+ <indexterm><primary>pg_statio_sys_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
system sequences are shown. (Presently, no system sequences are defined,
so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_sequences</structname>
+ <indexterm><primary>pg_statio_user_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-user-functions-view"><structname>pg_stat_user_functions</structname></link>
+ <indexterm><primary>pg_stat_user_functions</primary></indexterm>
+ </entry>
<entry>
One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
+ about executions of that function.
</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_functions</structname>
+ <indexterm><primary>pg_stat_xact_user_functions</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
calls during the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_user_functions</structname>).</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-stats-view"><structname>pg_stat_subscription_stats</structname></link>
+ <indexterm><primary>pg_stat_subscription_stats</primary></indexterm>
+ </entry>
<entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
</entry>
</row>
@@ -3136,7 +3208,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<primary>pg_stat_subscription</primary>
</indexterm>
- <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+ <table id="pg-stat-subscription-view" xreflabel="pg_stat_subscription">
<title><structname>pg_stat_subscription</structname> View</title>
<tgroup cols="1">
<thead>
@@ -3252,7 +3324,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
one row per subscription.
</para>
- <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
+ <table id="pg-stat-subscription-stats-view" xreflabel="pg_stat_subscription_stats">
<title><structname>pg_stat_subscription_stats</structname> View</title>
<tgroup cols="1">
<thead>
--
1.8.3.1
On 23.11.22 09:36, Peter Smith wrote:
PSA new patches. Now there are 6 of them. If some of the earlier
patches are agreeable can those ones please be committed? (because I
think this patch may be susceptible to needing a big rebase if
anything in those tables changes).
I have committed
v6-0001-Re-order-sections-of-28.4.-Progress-Reporting.patch
v6-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patch
v6-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patch
which seemed to have clear consensus.
v6-0002-Re-order-Table-28.2-Collected-Statistics-Views.patch
This one also seems ok, need a bit more time to look it over.
v6-0005-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patch
v6-0006-Remove-all-stats-views-from-the-ToC-of-28.2.patch
I wasn't sure yet whether these had been reviewed yet, sine they were
late additions to the patch series.
On Fri, Nov 25, 2022 at 5:09 AM Peter Eisentraut <
peter.eisentraut@enterprisedb.com> wrote:
On 23.11.22 09:36, Peter Smith wrote:
v6-0005-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patch
v6-0006-Remove-all-stats-views-from-the-ToC-of-28.2.patchI wasn't sure yet whether these had been reviewed yet, sine they were
late additions to the patch series.
They have not been reviewed.
If it's a matter of either-or I'd really prefer one page per grouping over
getting rid of the table-of-contents. But I suspect there has to be some
way to add an sgml element to the markup to force a new page and would
prefer to confirm or refute that prior to committing 0006.
0005 seems a win either way though I haven't reviewed it yet.
David J.
On Wed, Nov 23, 2022 at 1:36 AM Peter Smith <smithpb2250@gmail.com> wrote:
On Thu, Nov 17, 2022 at 8:46 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:Also, make it so each view ends up being its own separate page.
I did not do this. AFAIK those views of chapter 54 get rendered to
separate pages only because they are top-level <sect1>. So I do not
know how to put all these stats views onto different pages without
radically changing the document structure. Anyway – doing this would
be incompatible with my <sect3> changes of patch 0006 (see above).
I did some experimentation and reading on this today. Short answer - turn
each view into a refentry under a dedicated sect2 where the table resides.
David J.
<chapter>
[...]
<sect1> <!--The Cumulative Statistics System -->
[...]
<sect2>
<title>Statistics Views</title>
<para>Table of Statistics Views...</para>
<refentry id="monitoring-pg-stat-activity-view">
<refnamediv><refname>pg_stat_activity</refname><refpurpose>Purpose</refpurpose></refnamediv>
<refsect1>
<title><structname>pg_stat_activity</structname></title>
<indexterm>
<primary>pg_stat_activity</primary>
</indexterm>
</refsect1></refentry>
</sect2> <!-- Statistics Views -->
</sect1>
</chapter>
I was doing quite a bit of experimentation and basically gutted the actual
page to make that easier. The end result looked basically like below.
Chapter 28. Monitoring Database Activity
Table of Contents
28.1. Standard Unix Tools
28.2. The Cumulative Statistics System
28.2.1. Statistics Collection Configuration
28.2.2. Viewing Statistics
28.2.3. Statistics Views
A database administrator frequently wonders, “What is the system doing
right now?” This chapter discusses how to find that out.
Several tools are available for monitoring database activity and analyzing
performance. Most of this chapter is devoted to describing PostgreSQL's
cumulative statistics system, but one should not neglect regular Unix
monitoring programs such as ps, top, iostat, and vmstat. Also, once one has
identified a poorly-performing query, further investigation might be needed
using PostgreSQL's EXPLAIN command. Section 14.1 discusses EXPLAIN and
other methods for understanding the behavior of an individual query.
============== Page for 28.2 (sect1) ==============
28.2. The Cumulative Statistics System
28.2.1. Statistics Collection Configuration
28.2.2. Viewing Statistics
28.2.3. Statistics Views
PostgreSQL's cumulative statistics system supports collection and reporting
of information about server activity. Presently, accesses to tables and
indexes in both disk-block and individual-row terms are counted. The total
number of rows in each table, and information about vacuum and analyze
actions for each table are also counted. If enabled, calls to user-defined
functions and the total time spent in each one are counted as well.
PostgreSQL also supports reporting dynamic information about exactly what
is going on in the system right now, such as the exact command currently
being executed by other server processes, and which other connections exist
in the system. This facility is independent of the cumulative statistics
system.
28.2.1. Statistics Collection Configuration
Since collection of statistics adds some overhead to query execution, the
system can be configured to collect or not collect information. This is
controlled by configuration parameters that are normally set in
postgresql.conf. (See Chapter 20 for details about setting configuration
parameters.)
The parameter track_activities enables monitoring of the current command
being executed by any server process.
The parameter track_counts controls whether cumulative statistics are
collected about table and index accesses.
The parameter track_functions enables tracking of usage of user-defined
functions.
The parameter track_io_timing enables monitoring of block read and write
times.
The parameter track_wal_io_timing enables monitoring of WAL write times.
Normally these parameters are set in postgresql.conf so that they apply to
all server processes, but it is possible to turn them on or off in
individual sessions using the SET command. (To prevent ordinary users from
hiding their activity from the administrator, only superusers are allowed
to change these parameters with SET.)
Cumulative statistics are collected in shared memory. Every PostgreSQL
process collects statistics locally, then updates the shared data at
appropriate intervals. When a server, including a physical replica, shuts
down cleanly, a permanent copy of the statistics data is stored in the
pg_stat subdirectory, so that statistics can be retained across server
restarts. In contrast, when starting from an unclean shutdown (e.g., after
an immediate shutdown, a server crash, starting from a base backup, and
point-in-time recovery), all statistics counters are reset.
28.2.2. Viewing Statistics
test
28.2.3. Statistics Views
Table of Statistics Views...
===============
file:///usr/local/pgsql/share/doc/html/monitoring-pg-stat-activity-view.html
=============
(no ToC entry but the Next link in our footer does point to here)
pg_stat_activity
pg_stat_activity — Purpose
pg_stat_activity
The pg_stat_activity view will have one row per server process, showing
information related to the current activity of that process.
Here is an example of how wait events can be viewed:
SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE
wait_event is NOT NULL;
pid | wait_event_type | wait_event
------+-----------------+------------
2540 | Lock | relation
6644 | LWLock | ProcArray
(2 rows)
On Fri, Nov 25, 2022 at 11:09 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
On 23.11.22 09:36, Peter Smith wrote:
PSA new patches. Now there are 6 of them. If some of the earlier
patches are agreeable can those ones please be committed? (because I
think this patch may be susceptible to needing a big rebase if
anything in those tables changes).I have committed
v6-0001-Re-order-sections-of-28.4.-Progress-Reporting.patch
v6-0003-Re-order-Table-28.12-Wait-Events-of-type-LWLock.patch
v6-0004-Re-order-Table-28.35-Per-Backend-Statistics-Funct.patchwhich seemed to have clear consensus.
v6-0002-Re-order-Table-28.2-Collected-Statistics-Views.patch
This one also seems ok, need a bit more time to look it over.
v6-0005-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patch
v6-0006-Remove-all-stats-views-from-the-ToC-of-28.2.patchI wasn't sure yet whether these had been reviewed yet, sine they were
late additions to the patch series.
Thank you for pushing those ones.
PSA the remaining patches re-posted so cfbot can keep working
v6-0002 --> v7-0001
v6-0005 -> v7-0002
v6-0006 -> v7-0003
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v7-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchapplication/octet-stream; name=v7-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchDownload
From cfdb9597e9f0eb8f51e526435081bdbc3456cc0a Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 28 Nov 2022 10:22:35 +1100
Subject: [PATCH v7] Re-order Table 28.2 "Collected Statistics Views"
---
doc/src/sgml/monitoring.sgml | 78 ++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 5579b8b..f776f25 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -475,6 +475,23 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -497,6 +514,28 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
@@ -540,28 +579,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
<entry>
One row for each index in the current database,
@@ -624,23 +641,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
<entry>One row per subscription, showing statistics about errors.
See <link linkend="monitoring-pg-stat-subscription-stats">
--
1.8.3.1
v7-0003-Remove-all-stats-views-from-the-ToC-of-28.2.patchapplication/octet-stream; name=v7-0003-Remove-all-stats-views-from-the-ToC-of-28.2.patchDownload
From c097a969e895df8448b90737180e1fd7984b73a6 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 28 Nov 2022 10:30:24 +1100
Subject: [PATCH v7] Remove all stats views from the ToC of 28.2.
This was done by changing all the stats view to have <sect3> instead of <sect2>.
---
doc/src/sgml/monitoring.sgml | 86 ++++++++++++++++++++++----------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f7d0c2f..da6de70 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -746,9 +746,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
into the kernel's handling of I/O.
</para>
- </sect2>
-
- <sect2 id="monitoring-pg-stat-activity-view">
+ <sect3 id="monitoring-pg-stat-activity-view">
<title><structname>pg_stat_activity</structname></title>
<indexterm>
@@ -2391,9 +2389,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</programlisting>
</para>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-replication-view">
+ <sect3 id="monitoring-pg-stat-replication-view">
<title><structname>pg_stat_replication</structname></title>
<indexterm>
@@ -2728,9 +2726,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
+ <sect3 id="monitoring-pg-stat-replication-slots-view">
<title><structname>pg_stat_replication_slots</structname></title>
<indexterm>
@@ -2877,9 +2875,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
+ <sect3 id="monitoring-pg-stat-wal-receiver-view">
<title><structname>pg_stat_wal_receiver</structname></title>
<indexterm>
@@ -3057,9 +3055,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
+ <sect3 id="monitoring-pg-stat-recovery-prefetch">
<title><structname>pg_stat_recovery_prefetch</structname></title>
<indexterm>
@@ -3203,9 +3201,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-subscription">
+ <sect3 id="monitoring-pg-stat-subscription">
<title><structname>pg_stat_subscription</structname></title>
<indexterm>
@@ -3314,9 +3312,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-subscription-stats">
+ <sect3 id="monitoring-pg-stat-subscription-stats">
<title><structname>pg_stat_subscription_stats</structname></title>
<indexterm>
@@ -3392,9 +3390,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-ssl-view">
+ <sect3 id="monitoring-pg-stat-ssl-view">
<title><structname>pg_stat_ssl</structname></title>
<indexterm>
@@ -3513,9 +3511,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-gssapi-view">
+ <sect3 id="monitoring-pg-stat-gssapi-view">
<title><structname>pg_stat_gssapi</structname></title>
<indexterm>
@@ -3588,9 +3586,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-archiver-view">
+ <sect3 id="monitoring-pg-stat-archiver-view">
<title><structname>pg_stat_archiver</structname></title>
<indexterm>
@@ -3692,9 +3690,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
archived.
</para>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-bgwriter-view">
+ <sect3 id="monitoring-pg-stat-bgwriter-view">
<title><structname>pg_stat_bgwriter</structname></title>
<indexterm>
@@ -3829,9 +3827,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-wal-view">
+ <sect3 id="monitoring-pg-stat-wal-view">
<title><structname>pg_stat_wal</structname></title>
<indexterm>
@@ -3963,9 +3961,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
-</sect2>
+</sect3>
- <sect2 id="monitoring-pg-stat-database-view">
+ <sect3 id="monitoring-pg-stat-database-view">
<title><structname>pg_stat_database</structname></title>
<indexterm>
@@ -4288,9 +4286,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
+ <sect3 id="monitoring-pg-stat-database-conflicts-view">
<title><structname>pg_stat_database_conflicts</structname></title>
<indexterm>
@@ -4391,9 +4389,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-all-tables-view">
+ <sect3 id="monitoring-pg-stat-all-tables-view">
<title><structname>pg_stat_all_tables</structname></title>
<indexterm>
@@ -4662,9 +4660,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-all-indexes-view">
+ <sect3 id="monitoring-pg-stat-all-indexes-view">
<title><structname>pg_stat_all_indexes</structname></title>
<indexterm>
@@ -4811,9 +4809,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-tables-view">
+ <sect3 id="monitoring-pg-statio-all-tables-view">
<title><structname>pg_statio_all_tables</structname></title>
<indexterm>
@@ -4947,9 +4945,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-indexes-view">
+ <sect3 id="monitoring-pg-statio-all-indexes-view">
<title><structname>pg_statio_all_indexes</structname></title>
<indexterm>
@@ -5047,9 +5045,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-statio-all-sequences-view">
+ <sect3 id="monitoring-pg-statio-all-sequences-view">
<title><structname>pg_statio_all_sequences</structname></title>
<indexterm>
@@ -5125,9 +5123,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-user-functions-view">
+ <sect3 id="monitoring-pg-stat-user-functions-view">
<title><structname>pg_stat_user_functions</structname></title>
<indexterm>
@@ -5215,9 +5213,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </sect3>
- <sect2 id="monitoring-pg-stat-slru-view">
+ <sect3 id="monitoring-pg-stat-slru-view">
<title><structname>pg_stat_slru</structname></title>
<indexterm>
@@ -5337,6 +5335,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
+ </sect3>
+
</sect2>
<sect2 id="monitoring-stats-functions">
--
1.8.3.1
v7-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchapplication/octet-stream; name=v7-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchDownload
From 198322c7be6cbe16894e3772ff4747707800981c Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 28 Nov 2022 10:27:27 +1100
Subject: [PATCH v7] Cleanup view name hyperlinks for Tables 28.1 and 28.2
---
doc/src/sgml/monitoring.sgml | 256 +++++++++++++++++++++++++++----------------
1 file changed, 164 insertions(+), 92 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f776f25..f7d0c2f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -304,114 +304,130 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
<entry>
- <structname>pg_stat_activity</structname>
+ <link linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
<indexterm><primary>pg_stat_activity</primary></indexterm>
</entry>
<entry>
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See <link linkend="monitoring-pg-stat-activity-view">
- <structname>pg_stat_activity</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-view"><structname>pg_stat_replication</structname></link>
+ <indexterm><primary>pg_stat_replication</primary></indexterm>
+ </entry>
<entry>One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-receiver-view"><structname>pg_stat_wal_receiver</structname></link>
+ <indexterm><primary>pg_stat_wal_receiver</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-recovery-prefetch-view"><structname>pg_stat_recovery_prefetch</structname></link>
+ <indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-view"><structname>pg_stat_subscription</structname></link>
+ <indexterm><primary>pg_stat_subscription</primary></indexterm>
+ </entry>
<entry>At least one row per subscription, showing information about
the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-ssl-view"><structname>pg_stat_ssl</structname></link>
+ <indexterm><primary>pg_stat_ssl</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-gssapi-view"><structname>pg_stat_gssapi</structname></link>
+ <indexterm><primary>pg_stat_gssapi</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-analyze-view"><structname>pg_stat_progress_analyze</structname></link>
+ <indexterm><primary>pg_stat_progress_analyze</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_create_index</structname><indexterm><primary>pg_stat_progress_create_index</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-create-index-view"><structname>pg_stat_progress_create_index</structname></link>
+ <indexterm><primary>pg_stat_progress_create_index</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>CREATE INDEX</command> or <command>REINDEX</command>, showing
current progress.
- See <xref linkend='create-index-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_vacuum</structname><indexterm><primary>pg_stat_progress_vacuum</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-vacuum-view"><structname>pg_stat_progress_vacuum</structname></link>
+ <indexterm><primary>pg_stat_progress_vacuum</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>VACUUM</command>, showing current progress.
- See <xref linkend='vacuum-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-cluster-view"><structname>pg_stat_progress_cluster</structname></link>
+ <indexterm><primary>pg_stat_progress_cluster</primary></indexterm>
+ </entry>
<entry>One row for each backend running
<command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-basebackup-view"><structname>pg_stat_progress_basebackup</structname></link>
+ <indexterm><primary>pg_stat_progress_basebackup</primary></indexterm>
+ </entry>
<entry>One row for each WAL sender process streaming a base backup,
showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-copy-view"><structname>pg_stat_progress_copy</structname></link>
+ <indexterm><primary>pg_stat_progress_copy</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
</tbody>
@@ -431,112 +447,136 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
- <entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-archiver-view"><structname>pg_stat_archiver</structname></link>
+ <indexterm><primary>pg_stat_archiver</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
- <link linkend="monitoring-pg-stat-archiver-view">
- <structname>pg_stat_archiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_bgwriter</structname><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-bgwriter-view"><structname>pg_stat_bgwriter</structname></link>
+ <indexterm><primary>pg_stat_bgwriter</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
background writer process's activity. See
- <link linkend="monitoring-pg-stat-bgwriter-view">
- <structname>pg_stat_bgwriter</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-view"><structname>pg_stat_wal</structname></link>
+ <indexterm><primary>pg_stat_wal</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-view"><structname>pg_stat_database</structname></link>
+ <indexterm><primary>pg_stat_database</primary></indexterm>
+ </entry>
<entry>One row per database, showing database-wide statistics. See
- <link linkend="monitoring-pg-stat-database-view">
- <structname>pg_stat_database</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database_conflicts</structname><indexterm><primary>pg_stat_database_conflicts</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-conflicts-view"><structname>pg_stat_database_conflicts</structname></link>
+ <indexterm><primary>pg_stat_database_conflicts</primary></indexterm>
+ </entry>
<entry>
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See <link linkend="monitoring-pg-stat-database-conflicts-view">
- <structname>pg_stat_database_conflicts</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-slru-view"><structname>pg_stat_slru</structname></link>
+ <indexterm><primary>pg_stat_slru</primary></indexterm>
+ </entry>
<entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-slots-view"><structname>pg_stat_replication_slots</structname></link>
+ <indexterm><primary>pg_stat_replication_slots</primary></indexterm>
+ </entry>
<entry>One row per replication slot, showing statistics about the
replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_all_tables</structname></link>
+ <indexterm><primary>pg_stat_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_tables</structname>
+ <indexterm><primary>pg_stat_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_tables</structname>
+ <indexterm><primary>pg_stat_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_all_tables</structname></link>
+ <indexterm><primary>pg_statio_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_tables</structname>
+ <indexterm><primary>pg_statio_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_tables</structname>
+ <indexterm><primary>pg_statio_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_all_tables</structname>
+ <indexterm><primary>pg_stat_xact_all_tables</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_all_tables</structname> and related views).
@@ -545,106 +585,138 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_sys_tables</structname>
+ <indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_tables</structname>
+ <indexterm><primary>pg_stat_xact_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_all_indexes</structname></link>
+ <indexterm><primary>pg_stat_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_indexes</structname>
+ <indexterm><primary>pg_stat_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_indexes</structname>
+ <indexterm><primary>pg_stat_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_all_indexes</structname></link>
+ <indexterm><primary>pg_statio_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See <link linkend="monitoring-pg-statio-all-indexes-view">
- <structname>pg_statio_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_indexes</structname>
+ <indexterm><primary>pg_statio_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_indexes</structname>
+ <indexterm><primary>pg_statio_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_all_sequences</structname></link>
+ <indexterm><primary>pg_statio_all_sequences</primary></indexterm>
+ </entry>
<entry>
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See <link linkend="monitoring-pg-statio-all-sequences-view">
- <structname>pg_statio_all_sequences</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_sequences</structname>
+ <indexterm><primary>pg_statio_sys_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
system sequences are shown. (Presently, no system sequences are defined,
so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_sequences</structname>
+ <indexterm><primary>pg_statio_user_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-user-functions-view"><structname>pg_stat_user_functions</structname></link>
+ <indexterm><primary>pg_stat_user_functions</primary></indexterm>
+ </entry>
<entry>
One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
+ about executions of that function.
</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_functions</structname>
+ <indexterm><primary>pg_stat_xact_user_functions</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
calls during the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_user_functions</structname>).</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-stats-view"><structname>pg_stat_subscription_stats</structname></link>
+ <indexterm><primary>pg_stat_subscription_stats</primary></indexterm>
+ </entry>
<entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
</entry>
</row>
@@ -3140,7 +3212,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<primary>pg_stat_subscription</primary>
</indexterm>
- <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+ <table id="pg-stat-subscription-view" xreflabel="pg_stat_subscription">
<title><structname>pg_stat_subscription</structname> View</title>
<tgroup cols="1">
<thead>
@@ -3256,7 +3328,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
one row per subscription.
</para>
- <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
+ <table id="pg-stat-subscription-stats-view" xreflabel="pg_stat_subscription_stats">
<title><structname>pg_stat_subscription_stats</structname> View</title>
<tgroup cols="1">
<thead>
--
1.8.3.1
On Sat, Nov 26, 2022 at 2:43 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
On Wed, Nov 23, 2022 at 1:36 AM Peter Smith <smithpb2250@gmail.com> wrote:
On Thu, Nov 17, 2022 at 8:46 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:Also, make it so each view ends up being its own separate page.
I did not do this. AFAIK those views of chapter 54 get rendered to
separate pages only because they are top-level <sect1>. So I do not
know how to put all these stats views onto different pages without
radically changing the document structure. Anyway – doing this would
be incompatible with my <sect3> changes of patch 0006 (see above).I did some experimentation and reading on this today. Short answer - turn each view into a refentry under a dedicated sect2 where the table resides.
Thanks very much for your suggestion.
I will look at redoing the v7-0003 patch using that approach when I
get some more time (maybe in a day or so),
------
Kind Regards,
Peter Smith.
Fujitsu Australia
On Sat, Nov 26, 2022 at 2:43 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
On Wed, Nov 23, 2022 at 1:36 AM Peter Smith <smithpb2250@gmail.com> wrote:
On Thu, Nov 17, 2022 at 8:46 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:Also, make it so each view ends up being its own separate page.
I did not do this. AFAIK those views of chapter 54 get rendered to
separate pages only because they are top-level <sect1>. So I do not
know how to put all these stats views onto different pages without
radically changing the document structure. Anyway – doing this would
be incompatible with my <sect3> changes of patch 0006 (see above).I did some experimentation and reading on this today. Short answer - turn each view into a refentry under a dedicated sect2 where the table resides.
David J.
<chapter>
[...]
<sect1> <!--The Cumulative Statistics System -->
[...]
<sect2>
<title>Statistics Views</title>
<para>Table of Statistics Views...</para><refentry id="monitoring-pg-stat-activity-view">
<refnamediv><refname>pg_stat_activity</refname><refpurpose>Purpose</refpurpose></refnamediv>
<refsect1>
<title><structname>pg_stat_activity</structname></title><indexterm>
<primary>pg_stat_activity</primary>
</indexterm></refsect1></refentry>
</sect2> <!-- Statistics Views -->
</sect1>
</chapter>I was doing quite a bit of experimentation and basically gutted the actual page to make that easier. The end result looked basically like below.
Chapter 28. Monitoring Database Activity
Table of Contents
28.1. Standard Unix Tools
28.2. The Cumulative Statistics System28.2.1. Statistics Collection Configuration
28.2.2. Viewing Statistics
28.2.3. Statistics Views
PSA v8* patches.
Here, patches 0001 and 0002 are unchanged, but 0003 has many changes
per David's suggestion [1]David's restructure suggestion /messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com to change all these views to <refentry>
blocks.
So, I've done pretty much the same as per the above advice, except:
- I just called the <refpurpose> text for all these views "View"
- I changed the <refsect1> <title> to be "Description". This renders
nicer (without the double text of the view name) and is also more in
keeping with the example I found here [2]Example of a refentry https://tdg.docbook.org/tdg/3.1/refentry.html.
End result seems OK. YMMV.
~
Note that the refentry order within the monitoring.sgml is unchanged
from the previous <sect2> section order, so it's neither alphabetical
nor is it in the same order as within the tables. This is noticeable
only if you pay attention to the NEXT/PREV links at the bottom of the
browser page... so I'm not sure if it's worth shuffling these refentry
blocks into some better order or not?
------
[1]: David's restructure suggestion /messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com
/messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com
[2]: Example of a refentry https://tdg.docbook.org/tdg/3.1/refentry.html
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v8-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchapplication/octet-stream; name=v8-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchDownload
From e9f32529571f5834d7931cdb0c876d16bd22fa46 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 29 Nov 2022 14:43:52 +1100
Subject: [PATCH v8] Re-order Table 28.2 "Collected Statistics Views"
---
doc/src/sgml/monitoring.sgml | 78 ++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 5579b8b..f776f25 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -475,6 +475,23 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -497,6 +514,28 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ One row for each table in the current database, showing statistics
+ about I/O on that specific table.
+ See <link linkend="monitoring-pg-statio-all-tables-view">
+ <structname>pg_statio_all_tables</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ system tables are shown.</entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
+ user tables are shown.</entry>
+ </row>
+
+ <row>
<entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
@@ -540,28 +579,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>
- One row for each table in the current database, showing statistics
- about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- system tables are shown.</entry>
- </row>
-
- <row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
- <entry>Same as <structname>pg_statio_all_tables</structname>, except that only
- user tables are shown.</entry>
- </row>
-
- <row>
<entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
<entry>
One row for each index in the current database,
@@ -624,23 +641,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
<entry>One row per subscription, showing statistics about errors.
See <link linkend="monitoring-pg-stat-subscription-stats">
--
1.8.3.1
v8-0003-Add-Statistics-Views-section-and-refentry-for-eac.patchapplication/octet-stream; name=v8-0003-Add-Statistics-Views-section-and-refentry-for-eac.patchDownload
From 3e824c34980255e022a2085159a6e36daa986667 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 29 Nov 2022 18:00:48 +1100
Subject: [PATCH v8] Add "Statistics Views" section and refentry for each view.
---
doc/src/sgml/monitoring.sgml | 257 ++++++++++++++++++++++++++++++++-----------
1 file changed, 194 insertions(+), 63 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f7d0c2f..58cd655 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -290,6 +290,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
linkend="predefined-roles"/>) can see all the information about all sessions.
</para>
+ </sect2>
+
+ <sect2 id="monitoring-stats-views-all">
+ <title>Statistics Views</title>
+
<table id="monitoring-stats-dynamic-views-table">
<title>Dynamic Statistics Views</title>
@@ -746,10 +751,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
into the kernel's handling of I/O.
</para>
- </sect2>
+ <refentry id="monitoring-pg-stat-activity-view">
+ <refnamediv>
+ <refname><structname>pg_stat_activity</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-activity-view">
- <title><structname>pg_stat_activity</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_activity</primary>
@@ -2391,10 +2400,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</programlisting>
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-view">
- <title><structname>pg_stat_replication</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication</primary>
@@ -2728,10 +2743,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-slots-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication_slots</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
- <title><structname>pg_stat_replication_slots</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication_slots</primary>
@@ -2877,10 +2898,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
- <title><structname>pg_stat_wal_receiver</structname></title>
+ <refentry id="monitoring-pg-stat-wal-receiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal_receiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal_receiver</primary>
@@ -3057,10 +3084,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
- <title><structname>pg_stat_recovery_prefetch</structname></title>
+ <refentry id="monitoring-pg-stat-recovery-prefetch">
+ <refnamediv>
+ <refname><structname>pg_stat_recovery_prefetch</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_recovery_prefetch</primary>
@@ -3203,10 +3236,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription">
- <title><structname>pg_stat_subscription</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription</primary>
@@ -3314,10 +3353,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription-stats">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription_stats</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription-stats">
- <title><structname>pg_stat_subscription_stats</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription_stats</primary>
@@ -3392,10 +3437,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-ssl-view">
- <title><structname>pg_stat_ssl</structname></title>
+ <refentry id="monitoring-pg-stat-ssl-view">
+ <refnamediv>
+ <refname><structname>pg_stat_ssl</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_ssl</primary>
@@ -3513,10 +3564,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-gssapi-view">
+ <refnamediv>
+ <refname><structname>pg_stat_gssapi</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-gssapi-view">
- <title><structname>pg_stat_gssapi</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_gssapi</primary>
@@ -3588,10 +3645,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-archiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_archiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-archiver-view">
- <title><structname>pg_stat_archiver</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_archiver</primary>
@@ -3692,10 +3755,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
archived.
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-bgwriter-view">
+ <refnamediv>
+ <refname><structname>pg_stat_bgwriter</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-bgwriter-view">
- <title><structname>pg_stat_bgwriter</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_bgwriter</primary>
@@ -3829,10 +3898,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-view">
- <title><structname>pg_stat_wal</structname></title>
+ <refentry id="monitoring-pg-stat-wal-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal</primary>
@@ -3963,10 +4038,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
-</sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-database-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-database-view">
- <title><structname>pg_stat_database</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database</primary>
@@ -4288,10 +4369,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
- <title><structname>pg_stat_database_conflicts</structname></title>
+ <refentry id="monitoring-pg-stat-database-conflicts-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database_conflicts</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database_conflicts</primary>
@@ -4391,10 +4478,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-tables-view">
- <title><structname>pg_stat_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_tables</primary>
@@ -4662,10 +4755,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-indexes-view">
- <title><structname>pg_stat_all_indexes</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_indexes</primary>
@@ -4811,10 +4910,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-tables-view">
- <title><structname>pg_statio_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_tables</primary>
@@ -4947,10 +5052,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-statio-all-indexes-view">
- <title><structname>pg_statio_all_indexes</structname></title>
+ <refentry id="monitoring-pg-statio-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_indexes</primary>
@@ -5047,10 +5158,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-sequences-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_sequences</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-sequences-view">
- <title><structname>pg_statio_all_sequences</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_sequences</primary>
@@ -5125,10 +5242,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-user-functions-view">
+ <refnamediv>
+ <refname><structname>pg_stat_user_functions</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-user-functions-view">
- <title><structname>pg_stat_user_functions</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_user_functions</primary>
@@ -5215,10 +5338,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-slru-view">
- <title><structname>pg_stat_slru</structname></title>
+ <refentry id="monitoring-pg-stat-slru-view">
+ <refnamediv>
+ <refname><structname>pg_stat_slru</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>SLRU</primary>
@@ -5337,6 +5466,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
+ </refsect1></refentry>
+
</sect2>
<sect2 id="monitoring-stats-functions">
--
1.8.3.1
v8-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchapplication/octet-stream; name=v8-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchDownload
From 98c6fc424ca0cd869d5a06bc2015143cd8a35d1b Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 29 Nov 2022 14:46:41 +1100
Subject: [PATCH v8] Cleanup view name hyperlinks for Tables 28.1 and 28.2
---
doc/src/sgml/monitoring.sgml | 256 +++++++++++++++++++++++++++----------------
1 file changed, 164 insertions(+), 92 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f776f25..f7d0c2f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -304,114 +304,130 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
<entry>
- <structname>pg_stat_activity</structname>
+ <link linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
<indexterm><primary>pg_stat_activity</primary></indexterm>
</entry>
<entry>
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See <link linkend="monitoring-pg-stat-activity-view">
- <structname>pg_stat_activity</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-view"><structname>pg_stat_replication</structname></link>
+ <indexterm><primary>pg_stat_replication</primary></indexterm>
+ </entry>
<entry>One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-receiver-view"><structname>pg_stat_wal_receiver</structname></link>
+ <indexterm><primary>pg_stat_wal_receiver</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-recovery-prefetch-view"><structname>pg_stat_recovery_prefetch</structname></link>
+ <indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-view"><structname>pg_stat_subscription</structname></link>
+ <indexterm><primary>pg_stat_subscription</primary></indexterm>
+ </entry>
<entry>At least one row per subscription, showing information about
the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-ssl-view"><structname>pg_stat_ssl</structname></link>
+ <indexterm><primary>pg_stat_ssl</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-gssapi-view"><structname>pg_stat_gssapi</structname></link>
+ <indexterm><primary>pg_stat_gssapi</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-analyze-view"><structname>pg_stat_progress_analyze</structname></link>
+ <indexterm><primary>pg_stat_progress_analyze</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_create_index</structname><indexterm><primary>pg_stat_progress_create_index</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-create-index-view"><structname>pg_stat_progress_create_index</structname></link>
+ <indexterm><primary>pg_stat_progress_create_index</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>CREATE INDEX</command> or <command>REINDEX</command>, showing
current progress.
- See <xref linkend='create-index-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_vacuum</structname><indexterm><primary>pg_stat_progress_vacuum</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-vacuum-view"><structname>pg_stat_progress_vacuum</structname></link>
+ <indexterm><primary>pg_stat_progress_vacuum</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>VACUUM</command>, showing current progress.
- See <xref linkend='vacuum-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-cluster-view"><structname>pg_stat_progress_cluster</structname></link>
+ <indexterm><primary>pg_stat_progress_cluster</primary></indexterm>
+ </entry>
<entry>One row for each backend running
<command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-basebackup-view"><structname>pg_stat_progress_basebackup</structname></link>
+ <indexterm><primary>pg_stat_progress_basebackup</primary></indexterm>
+ </entry>
<entry>One row for each WAL sender process streaming a base backup,
showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-copy-view"><structname>pg_stat_progress_copy</structname></link>
+ <indexterm><primary>pg_stat_progress_copy</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
</tbody>
@@ -431,112 +447,136 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
- <entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-archiver-view"><structname>pg_stat_archiver</structname></link>
+ <indexterm><primary>pg_stat_archiver</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
- <link linkend="monitoring-pg-stat-archiver-view">
- <structname>pg_stat_archiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_bgwriter</structname><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-bgwriter-view"><structname>pg_stat_bgwriter</structname></link>
+ <indexterm><primary>pg_stat_bgwriter</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
background writer process's activity. See
- <link linkend="monitoring-pg-stat-bgwriter-view">
- <structname>pg_stat_bgwriter</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-view"><structname>pg_stat_wal</structname></link>
+ <indexterm><primary>pg_stat_wal</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-view"><structname>pg_stat_database</structname></link>
+ <indexterm><primary>pg_stat_database</primary></indexterm>
+ </entry>
<entry>One row per database, showing database-wide statistics. See
- <link linkend="monitoring-pg-stat-database-view">
- <structname>pg_stat_database</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database_conflicts</structname><indexterm><primary>pg_stat_database_conflicts</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-conflicts-view"><structname>pg_stat_database_conflicts</structname></link>
+ <indexterm><primary>pg_stat_database_conflicts</primary></indexterm>
+ </entry>
<entry>
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See <link linkend="monitoring-pg-stat-database-conflicts-view">
- <structname>pg_stat_database_conflicts</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-slru-view"><structname>pg_stat_slru</structname></link>
+ <indexterm><primary>pg_stat_slru</primary></indexterm>
+ </entry>
<entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-slots-view"><structname>pg_stat_replication_slots</structname></link>
+ <indexterm><primary>pg_stat_replication_slots</primary></indexterm>
+ </entry>
<entry>One row per replication slot, showing statistics about the
replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_all_tables</structname></link>
+ <indexterm><primary>pg_stat_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_tables</structname>
+ <indexterm><primary>pg_stat_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_tables</structname>
+ <indexterm><primary>pg_stat_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_all_tables</structname></link>
+ <indexterm><primary>pg_statio_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_tables</structname>
+ <indexterm><primary>pg_statio_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_tables</structname>
+ <indexterm><primary>pg_statio_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_all_tables</structname>
+ <indexterm><primary>pg_stat_xact_all_tables</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_all_tables</structname> and related views).
@@ -545,106 +585,138 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_sys_tables</structname>
+ <indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_tables</structname>
+ <indexterm><primary>pg_stat_xact_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_all_indexes</structname></link>
+ <indexterm><primary>pg_stat_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_sys_indexes</structname>
+ <indexterm><primary>pg_stat_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_user_indexes</structname>
+ <indexterm><primary>pg_stat_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_all_indexes</structname></link>
+ <indexterm><primary>pg_statio_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See <link linkend="monitoring-pg-statio-all-indexes-view">
- <structname>pg_statio_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_indexes</structname>
+ <indexterm><primary>pg_statio_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_indexes</structname>
+ <indexterm><primary>pg_statio_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_all_sequences</structname></link>
+ <indexterm><primary>pg_statio_all_sequences</primary></indexterm>
+ </entry>
<entry>
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See <link linkend="monitoring-pg-statio-all-sequences-view">
- <structname>pg_statio_all_sequences</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_sys_sequences</structname>
+ <indexterm><primary>pg_statio_sys_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
system sequences are shown. (Presently, no system sequences are defined,
so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>
+ <structname>pg_statio_user_sequences</structname>
+ <indexterm><primary>pg_statio_user_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
user sequences are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-user-functions-view"><structname>pg_stat_user_functions</structname></link>
+ <indexterm><primary>pg_stat_user_functions</primary></indexterm>
+ </entry>
<entry>
One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
+ about executions of that function.
</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>
+ <structname>pg_stat_xact_user_functions</structname>
+ <indexterm><primary>pg_stat_xact_user_functions</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
calls during the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_user_functions</structname>).</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-stats-view"><structname>pg_stat_subscription_stats</structname></link>
+ <indexterm><primary>pg_stat_subscription_stats</primary></indexterm>
+ </entry>
<entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
</entry>
</row>
@@ -3140,7 +3212,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<primary>pg_stat_subscription</primary>
</indexterm>
- <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+ <table id="pg-stat-subscription-view" xreflabel="pg_stat_subscription">
<title><structname>pg_stat_subscription</structname> View</title>
<tgroup cols="1">
<thead>
@@ -3256,7 +3328,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
one row per subscription.
</para>
- <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
+ <table id="pg-stat-subscription-stats-view" xreflabel="pg_stat_subscription_stats">
<title><structname>pg_stat_subscription_stats</structname> View</title>
<tgroup cols="1">
<thead>
--
1.8.3.1
On 29.11.22 08:29, Peter Smith wrote:
PSA v8* patches.
Here, patches 0001 and 0002 are unchanged, but 0003 has many changes
per David's suggestion [1] to change all these views to <refentry>
blocks.
I don't understand what order 0001 is trying to achieve. I know we
didn't necessarily want to go fully alphabetic, but if we're going to
spend time on this, let's come up with a system that the next
contributor who adds a view will be able to understand and follow.
As an aside, I find the mixing of pg_stat_* and pg_statio_* views
visually distracting. It was easier to read before when they were in
separate blocks.
I think something like this would be manageable:
<!-- everything related to global objects, alphabetically -->
pg_stat_archiver
pg_stat_bgwriter
pg_stat_database
pg_stat_database_conflicts
pg_stat_replication_slots
pg_stat_slru
pg_stat_subscription_stats
pg_stat_wal
<!-- all "stat" for schema objects, by "importance" -->
pg_stat_all_tables
pg_stat_sys_tables
pg_stat_user_tables
pg_stat_xact_all_tables
pg_stat_xact_sys_tables
pg_stat_xact_user_tables
pg_stat_all_indexes
pg_stat_sys_indexes
pg_stat_user_indexes
pg_stat_user_functions
pg_stat_xact_user_functions
<!-- all "statio" for schema objects, by "importance" -->
pg_statio_all_tables
pg_statio_sys_tables
pg_statio_user_tables
pg_statio_all_indexes
pg_statio_sys_indexes
pg_statio_user_indexes
pg_statio_all_sequences
pg_statio_sys_sequences
pg_statio_user_sequences
In any case, the remaining patches are new and need further review, so
I'll move this to the next CF.
On Thu, Dec 1, 2022 at 2:20 AM Peter Eisentraut <
peter.eisentraut@enterprisedb.com> wrote:
On 29.11.22 08:29, Peter Smith wrote:
PSA v8* patches.
Here, patches 0001 and 0002 are unchanged, but 0003 has many changes
per David's suggestion [1] to change all these views to <refentry>
blocks.I don't understand what order 0001 is trying to achieve.
The rule behind 0001 is:
All global object stats
All table object stats (stat > statio > xact; all > sys > user)
All index object stats
All sequence object stats
All function object stats
As an aside, I find the mixing of pg_stat_* and pg_statio_* views
visually distracting. It was easier to read before when they were in
separate blocks.
I found that having the statio at the end of each object type block added a
natural partitioning for tables and indexes that the existing order lacked
and that made reading the table be more "wall-of-text-ish", and thus more
difficult to read, than necessary.
I'm not opposed to the following though. The object-type driven order just
feels more useful but I really cannot justify it beyond that.
I'm not particularly enamored with the existing single large table but
don't have a better structure to offer at this time.
I think something like this would be manageable:
<!-- everything related to global objects, alphabetically -->
pg_stat_archiver
pg_stat_bgwriter
pg_stat_database
pg_stat_database_conflicts
pg_stat_replication_slots
pg_stat_slru
pg_stat_subscription_stats
pg_stat_wal
WAL being adjacent to archiver/bgwriter seemed reasonable so I left that
alone.
Replication and Subscription being adjacent seemed reasonable so I left
that alone.
Thus slru ended up last, with database* remaining as-is.
At 8 items, with a group size average of 2, pure alphabetical is also
reasonable.
<!-- all "stat" for schema objects, by "importance" -->
<!-- all "statio" for schema objects, by "importance" -->
David J.
I'd like to "fix" this but IIUC there is no consensus yet about what
order is best for patch 0001, right?
------
Kind Regards,
Peter Smith.
Fujitsu Australia
On Tue, Dec 6, 2022 at 6:36 PM Peter Smith <smithpb2250@gmail.com> wrote:
I'd like to "fix" this but IIUC there is no consensus yet about what
order is best for patch 0001, right?
I'm planning on performing a more thorough review of 0003 and 0004 tomorrow.
As for 0001 - go with Peter E.'s suggested ordering.
David J.
On Tue, Dec 6, 2022 at 7:57 PM David G. Johnston <david.g.johnston@gmail.com>
wrote:
On Tue, Dec 6, 2022 at 6:36 PM Peter Smith <smithpb2250@gmail.com> wrote:
I'd like to "fix" this but IIUC there is no consensus yet about what
order is best for patch 0001, right?I'm planning on performing a more thorough review of 0003 and 0004
tomorrow.
Compiled just fine.
I do think every row of the views table should be hyperlinked. None of the
"xact" ones are for some reason. For the sys/user ones just point to the
same place as the corresponding "all" link.
pg_stat_subscription_stats needs to be moved up to the "globals" section.
There are a bunch of trailing ". See" in the descriptions now that need to
be cleaned up. (0002)
David J.
Thanks for the ongoing feedback.
PSA patches for v9*
v9-0001 - Now the table rows are ordered per PeterE's suggestions [1]/messages/by-id/cfdb0030-8f62-ed6d-4246-8d9bf855bc48@enterprisedb.com
v9-0002 - All the review comments from DavidJ [2]/messages/by-id/CAKFQuwby7xWHek8=6UPaNXrhGA-i0B2zMOmBoGHgc4yaO8NH_w@mail.gmail.com are addressed
v9-0003 - Unchanged since v8.
------
[1]: /messages/by-id/cfdb0030-8f62-ed6d-4246-8d9bf855bc48@enterprisedb.com
[2]: /messages/by-id/CAKFQuwby7xWHek8=6UPaNXrhGA-i0B2zMOmBoGHgc4yaO8NH_w@mail.gmail.com
Kind Regards,
Peter Smith.
Fujitsu Australia.
Attachments:
v9-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchapplication/octet-stream; name=v9-0001-Re-order-Table-28.2-Collected-Statistics-Views.patchDownload
From 71ded9ba7400ea6db52a161ca3472bf347944184 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 8 Dec 2022 09:56:18 +1100
Subject: [PATCH v9] Re-order Table 28.2 "Collected Statistics Views"
---
doc/src/sgml/monitoring.sgml | 107 +++++++++++++++++++++++--------------------
1 file changed, 57 insertions(+), 50 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 11a8ebe..d5020e1 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -430,6 +430,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</thead>
<tbody>
+
+ <!-- everything related to global objects, alphabetically -->
+
<row>
<entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
@@ -449,14 +452,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
- <entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
- </entry>
- </row>
-
- <row>
<entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
<entry>One row per database, showing database-wide statistics. See
<link linkend="monitoring-pg-stat-database-view">
@@ -475,6 +470,41 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>One row per replication slot, showing statistics about the
+ replication slot's usage. See
+ <link linkend="monitoring-pg-stat-replication-slots-view">
+ <structname>pg_stat_replication_slots</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
+ <entry>One row per SLRU, showing statistics of operations. See
+ <link linkend="monitoring-pg-stat-slru-view">
+ <structname>pg_stat_slru</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>One row per subscription, showing statistics about errors.
+ See <link linkend="monitoring-pg-stat-subscription-stats">
+ <structname>pg_stat_subscription_stats</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
+ <entry>One row only, showing statistics about WAL activity. See
+ <link linkend="monitoring-pg-stat-wal-view">
+ <structname>pg_stat_wal</structname></link> for details.
+ </entry>
+ </row>
+
+ <!-- all "stat" for schema objects, by "importance" -->
+
+ <row>
<entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -540,6 +570,25 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
+ <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
+ <entry>
+ One row for each tracked function, showing statistics
+ about executions of that function. See
+ <link linkend="monitoring-pg-stat-user-functions-view">
+ <structname>pg_stat_user_functions</structname></link> for details.
+ </entry>
+ </row>
+
+ <row>
+ <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
+ calls during the current transaction (which are <emphasis>not</emphasis>
+ yet included in <structname>pg_stat_user_functions</structname>).</entry>
+ </row>
+
+ <!-- all "statio" for schema objects, by "importance" -->
+
+ <row>
<entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
<entry>
One row for each table in the current database, showing statistics
@@ -606,48 +655,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
user sequences are shown.</entry>
</row>
- <row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
- <entry>
- One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
- <entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
- calls during the current transaction (which are <emphasis>not</emphasis>
- yet included in <structname>pg_stat_user_functions</structname>).</entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
- <entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
- </entry>
- </row>
-
- <row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
- <entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
- </entry>
- </row>
-
</tbody>
</tgroup>
</table>
--
1.8.3.1
v9-0003-Add-Statistics-Views-section-and-refentry-for-eac.patchapplication/octet-stream; name=v9-0003-Add-Statistics-Views-section-and-refentry-for-eac.patchDownload
From e72a2f715d23b6cb3242254dd9be6efea195b7d9 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 8 Dec 2022 13:20:27 +1100
Subject: [PATCH v9] Add "Statistics Views" section and refentry for each view.
---
doc/src/sgml/monitoring.sgml | 257 ++++++++++++++++++++++++++++++++-----------
1 file changed, 194 insertions(+), 63 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 6bcc093..b463257 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -290,6 +290,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
linkend="predefined-roles"/>) can see all the information about all sessions.
</para>
+ </sect2>
+
+ <sect2 id="monitoring-stats-views-all">
+ <title>Statistics Views</title>
+
<table id="monitoring-stats-dynamic-views-table">
<title>Dynamic Statistics Views</title>
@@ -753,10 +758,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
into the kernel's handling of I/O.
</para>
- </sect2>
+ <refentry id="monitoring-pg-stat-activity-view">
+ <refnamediv>
+ <refname><structname>pg_stat_activity</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-activity-view">
- <title><structname>pg_stat_activity</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_activity</primary>
@@ -2400,10 +2409,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</programlisting>
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-view">
- <title><structname>pg_stat_replication</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication</primary>
@@ -2737,10 +2752,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-slots-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication_slots</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
- <title><structname>pg_stat_replication_slots</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication_slots</primary>
@@ -2886,10 +2907,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
- <title><structname>pg_stat_wal_receiver</structname></title>
+ <refentry id="monitoring-pg-stat-wal-receiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal_receiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal_receiver</primary>
@@ -3066,10 +3093,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
- <title><structname>pg_stat_recovery_prefetch</structname></title>
+ <refentry id="monitoring-pg-stat-recovery-prefetch">
+ <refnamediv>
+ <refname><structname>pg_stat_recovery_prefetch</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_recovery_prefetch</primary>
@@ -3212,10 +3245,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription">
- <title><structname>pg_stat_subscription</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription</primary>
@@ -3323,10 +3362,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription-stats">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription_stats</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription-stats">
- <title><structname>pg_stat_subscription_stats</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription_stats</primary>
@@ -3401,10 +3446,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-ssl-view">
- <title><structname>pg_stat_ssl</structname></title>
+ <refentry id="monitoring-pg-stat-ssl-view">
+ <refnamediv>
+ <refname><structname>pg_stat_ssl</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_ssl</primary>
@@ -3522,10 +3573,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-gssapi-view">
+ <refnamediv>
+ <refname><structname>pg_stat_gssapi</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-gssapi-view">
- <title><structname>pg_stat_gssapi</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_gssapi</primary>
@@ -3597,10 +3654,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-archiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_archiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-archiver-view">
- <title><structname>pg_stat_archiver</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_archiver</primary>
@@ -3701,10 +3764,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
archived.
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-bgwriter-view">
+ <refnamediv>
+ <refname><structname>pg_stat_bgwriter</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-bgwriter-view">
- <title><structname>pg_stat_bgwriter</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_bgwriter</primary>
@@ -3838,10 +3907,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-view">
- <title><structname>pg_stat_wal</structname></title>
+ <refentry id="monitoring-pg-stat-wal-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal</primary>
@@ -3972,10 +4047,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
-</sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-database-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-database-view">
- <title><structname>pg_stat_database</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database</primary>
@@ -4297,10 +4378,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
- <title><structname>pg_stat_database_conflicts</structname></title>
+ <refentry id="monitoring-pg-stat-database-conflicts-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database_conflicts</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database_conflicts</primary>
@@ -4400,10 +4487,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-tables-view">
- <title><structname>pg_stat_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_tables</primary>
@@ -4671,10 +4764,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-indexes-view">
- <title><structname>pg_stat_all_indexes</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_indexes</primary>
@@ -4820,10 +4919,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-tables-view">
- <title><structname>pg_statio_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_tables</primary>
@@ -4956,10 +5061,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-statio-all-indexes-view">
- <title><structname>pg_statio_all_indexes</structname></title>
+ <refentry id="monitoring-pg-statio-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_indexes</primary>
@@ -5056,10 +5167,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-sequences-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_sequences</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-sequences-view">
- <title><structname>pg_statio_all_sequences</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_sequences</primary>
@@ -5134,10 +5251,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-user-functions-view">
+ <refnamediv>
+ <refname><structname>pg_stat_user_functions</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-user-functions-view">
- <title><structname>pg_stat_user_functions</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_user_functions</primary>
@@ -5224,10 +5347,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-slru-view">
- <title><structname>pg_stat_slru</structname></title>
+ <refentry id="monitoring-pg-stat-slru-view">
+ <refnamediv>
+ <refname><structname>pg_stat_slru</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>SLRU</primary>
@@ -5346,6 +5475,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
+ </refsect1></refentry>
+
</sect2>
<sect2 id="monitoring-stats-functions">
--
1.8.3.1
v9-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchapplication/octet-stream; name=v9-0002-Cleanup-view-name-hyperlinks-for-Tables-28.1-and-.patchDownload
From c0be5fd4a0ab37839a671d9c8e1e2ed45cf3f1d4 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 8 Dec 2022 13:12:02 +1100
Subject: [PATCH v9] Cleanup view name hyperlinks for Tables 28.1 and 28.2
---
doc/src/sgml/monitoring.sgml | 268 +++++++++++++++++++++++++++----------------
1 file changed, 170 insertions(+), 98 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d5020e1..6bcc093 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -304,114 +304,130 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
<entry>
- <structname>pg_stat_activity</structname>
+ <link linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
<indexterm><primary>pg_stat_activity</primary></indexterm>
</entry>
<entry>
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See <link linkend="monitoring-pg-stat-activity-view">
- <structname>pg_stat_activity</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-view"><structname>pg_stat_replication</structname></link>
+ <indexterm><primary>pg_stat_replication</primary></indexterm>
+ </entry>
<entry>One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See <link linkend="monitoring-pg-stat-replication-view">
- <structname>pg_stat_replication</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-wal-receiver-view"><structname>pg_stat_wal_receiver</structname></link>
+ <indexterm><primary>pg_stat_wal_receiver</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See <link linkend="monitoring-pg-stat-wal-receiver-view">
- <structname>pg_stat_wal_receiver</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-recovery-prefetch-view"><structname>pg_stat_recovery_prefetch</structname></link>
+ <indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm>
+ </entry>
<entry>Only one row, showing statistics about blocks prefetched during recovery.
- See <link linkend="monitoring-pg-stat-recovery-prefetch">
- <structname>pg_stat_recovery_prefetch</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-view"><structname>pg_stat_subscription</structname></link>
+ <indexterm><primary>pg_stat_subscription</primary></indexterm>
+ </entry>
<entry>At least one row per subscription, showing information about
the subscription workers.
- See <link linkend="monitoring-pg-stat-subscription">
- <structname>pg_stat_subscription</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-ssl-view"><structname>pg_stat_ssl</structname></link>
+ <indexterm><primary>pg_stat_ssl</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
SSL used on this connection.
- See <link linkend="monitoring-pg-stat-ssl-view">
- <structname>pg_stat_ssl</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_gssapi</structname><indexterm><primary>pg_stat_gssapi</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-gssapi-view"><structname>pg_stat_gssapi</structname></link>
+ <indexterm><primary>pg_stat_gssapi</primary></indexterm>
+ </entry>
<entry>One row per connection (regular and replication), showing information about
GSSAPI authentication and encryption used on this connection.
- See <link linkend="monitoring-pg-stat-gssapi-view">
- <structname>pg_stat_gssapi</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_analyze</structname><indexterm><primary>pg_stat_progress_analyze</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-analyze-view"><structname>pg_stat_progress_analyze</structname></link>
+ <indexterm><primary>pg_stat_progress_analyze</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>ANALYZE</command>, showing current progress.
- See <xref linkend='analyze-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_create_index</structname><indexterm><primary>pg_stat_progress_create_index</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-create-index-view"><structname>pg_stat_progress_create_index</structname></link>
+ <indexterm><primary>pg_stat_progress_create_index</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>CREATE INDEX</command> or <command>REINDEX</command>, showing
current progress.
- See <xref linkend='create-index-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_vacuum</structname><indexterm><primary>pg_stat_progress_vacuum</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-vacuum-view"><structname>pg_stat_progress_vacuum</structname></link>
+ <indexterm><primary>pg_stat_progress_vacuum</primary></indexterm>
+ </entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>VACUUM</command>, showing current progress.
- See <xref linkend='vacuum-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_cluster</structname><indexterm><primary>pg_stat_progress_cluster</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-cluster-view"><structname>pg_stat_progress_cluster</structname></link>
+ <indexterm><primary>pg_stat_progress_cluster</primary></indexterm>
+ </entry>
<entry>One row for each backend running
<command>CLUSTER</command> or <command>VACUUM FULL</command>, showing current progress.
- See <xref linkend='cluster-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-basebackup-view"><structname>pg_stat_progress_basebackup</structname></link>
+ <indexterm><primary>pg_stat_progress_basebackup</primary></indexterm>
+ </entry>
<entry>One row for each WAL sender process streaming a base backup,
showing current progress.
- See <xref linkend='basebackup-progress-reporting'/>.
</entry>
</row>
<row>
- <entry><structname>pg_stat_progress_copy</structname><indexterm><primary>pg_stat_progress_copy</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-progress-copy-view"><structname>pg_stat_progress_copy</structname></link>
+ <indexterm><primary>pg_stat_progress_copy</primary></indexterm>
+ </entry>
<entry>One row for each backend running <command>COPY</command>, showing current progress.
- See <xref linkend='copy-progress-reporting'/>.
</entry>
</row>
</tbody>
@@ -434,100 +450,118 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<!-- everything related to global objects, alphabetically -->
<row>
- <entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-archiver-view"><structname>pg_stat_archiver</structname></link>
+ <indexterm><primary>pg_stat_archiver</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
- WAL archiver process's activity. See
- <link linkend="monitoring-pg-stat-archiver-view">
- <structname>pg_stat_archiver</structname></link> for details.
+ WAL archiver process's activity.
</entry>
</row>
<row>
- <entry><structname>pg_stat_bgwriter</structname><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-bgwriter-view"><structname>pg_stat_bgwriter</structname></link>
+ <indexterm><primary>pg_stat_bgwriter</primary></indexterm>
+ </entry>
<entry>One row only, showing statistics about the
- background writer process's activity. See
- <link linkend="monitoring-pg-stat-bgwriter-view">
- <structname>pg_stat_bgwriter</structname></link> for details.
+ background writer process's activity.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
- <entry>One row per database, showing database-wide statistics. See
- <link linkend="monitoring-pg-stat-database-view">
- <structname>pg_stat_database</structname></link> for details.
+ <entry>
+ <link linkend="pg-stat-database-view"><structname>pg_stat_database</structname></link>
+ <indexterm><primary>pg_stat_database</primary></indexterm>
+ </entry>
+ <entry>One row per database, showing database-wide statistics.
</entry>
</row>
<row>
- <entry><structname>pg_stat_database_conflicts</structname><indexterm><primary>pg_stat_database_conflicts</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-database-conflicts-view"><structname>pg_stat_database_conflicts</structname></link>
+ <indexterm><primary>pg_stat_database_conflicts</primary></indexterm>
+ </entry>
<entry>
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See <link linkend="monitoring-pg-stat-database-conflicts-view">
- <structname>pg_stat_database_conflicts</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-replication-slots-view"><structname>pg_stat_replication_slots</structname></link>
+ <indexterm><primary>pg_stat_replication_slots</primary></indexterm>
+ </entry>
<entry>One row per replication slot, showing statistics about the
- replication slot's usage. See
- <link linkend="monitoring-pg-stat-replication-slots-view">
- <structname>pg_stat_replication_slots</structname></link> for details.
+ replication slot's usage.
</entry>
</row>
<row>
- <entry><structname>pg_stat_slru</structname><indexterm><primary>pg_stat_slru</primary></indexterm></entry>
- <entry>One row per SLRU, showing statistics of operations. See
- <link linkend="monitoring-pg-stat-slru-view">
- <structname>pg_stat_slru</structname></link> for details.
+ <entry>
+ <link linkend="pg-stat-slru-view"><structname>pg_stat_slru</structname></link>
+ <indexterm><primary>pg_stat_slru</primary></indexterm>
+ </entry>
+ <entry>One row per SLRU, showing statistics of operations.
</entry>
</row>
<row>
- <entry><structname>pg_stat_subscription_stats</structname><indexterm><primary>pg_stat_subscription_stats</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-subscription-stats-view"><structname>pg_stat_subscription_stats</structname></link>
+ <indexterm><primary>pg_stat_subscription_stats</primary></indexterm>
+ </entry>
<entry>One row per subscription, showing statistics about errors.
- See <link linkend="monitoring-pg-stat-subscription-stats">
- <structname>pg_stat_subscription_stats</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_wal</structname><indexterm><primary>pg_stat_wal</primary></indexterm></entry>
- <entry>One row only, showing statistics about WAL activity. See
- <link linkend="monitoring-pg-stat-wal-view">
- <structname>pg_stat_wal</structname></link> for details.
+ <entry>
+ <link linkend="pg-stat-wal-view"><structname>pg_stat_wal</structname></link>
+ <indexterm><primary>pg_stat_wal</primary></indexterm>
+ </entry>
+ <entry>One row only, showing statistics about WAL activity.
</entry>
</row>
<!-- all "stat" for schema objects, by "importance" -->
<row>
- <entry><structname>pg_stat_all_tables</structname><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_all_tables</structname></link>
+ <indexterm><primary>pg_stat_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See <link linkend="monitoring-pg-stat-all-tables-view">
- <structname>pg_stat_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_tables</structname><indexterm><primary>pg_stat_sys_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_sys_tables</structname></link>
+ <indexterm><primary>pg_stat_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_tables</structname><indexterm><primary>pg_stat_user_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_user_tables</structname></link>
+ <indexterm><primary>pg_stat_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_tables</structname>, except that only user
tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_all_tables</structname><indexterm><primary>pg_stat_xact_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_xact_all_tables</structname></link>
+ <indexterm><primary>pg_stat_xact_all_tables</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_all_tables</structname>, but counts actions
taken so far within the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_all_tables</structname> and related views).
@@ -536,51 +570,68 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
- <entry><structname>pg_stat_xact_sys_tables</structname><indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_xact_sys_tables</structname></link>
+ <indexterm><primary>pg_stat_xact_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_tables</structname><indexterm><primary>pg_stat_xact_user_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-tables-view"><structname>pg_stat_xact_user_tables</structname></link>
+ <indexterm><primary>pg_stat_xact_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_xact_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_all_indexes</structname><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_all_indexes</structname></link>
+ <indexterm><primary>pg_stat_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See <link linkend="monitoring-pg-stat-all-indexes-view">
- <structname>pg_stat_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_stat_sys_indexes</structname><indexterm><primary>pg_stat_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_sys_indexes</structname></link>
+ <indexterm><primary>pg_stat_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_indexes</structname><indexterm><primary>pg_stat_user_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-all-indexes-view"><structname>pg_stat_user_indexes</structname></link>
+ <indexterm><primary>pg_stat_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_stat_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_stat_user_functions</structname><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-user-functions-view"><structname>pg_stat_user_functions</structname></link>
+ <indexterm><primary>pg_stat_user_functions</primary></indexterm>
+ </entry>
<entry>
One row for each tracked function, showing statistics
- about executions of that function. See
- <link linkend="monitoring-pg-stat-user-functions-view">
- <structname>pg_stat_user_functions</structname></link> for details.
+ about executions of that function.
</entry>
</row>
<row>
- <entry><structname>pg_stat_xact_user_functions</structname><indexterm><primary>pg_stat_xact_user_functions</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-stat-user-functions-view"><structname>pg_stat_xact_user_functions</structname></link>
+ <indexterm><primary>pg_stat_xact_user_functions</primary></indexterm>
+ </entry>
<entry>Similar to <structname>pg_stat_user_functions</structname>, but counts only
calls during the current transaction (which are <emphasis>not</emphasis>
yet included in <structname>pg_stat_user_functions</structname>).</entry>
@@ -589,68 +640,89 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<!-- all "statio" for schema objects, by "importance" -->
<row>
- <entry><structname>pg_statio_all_tables</structname><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_all_tables</structname></link>
+ <indexterm><primary>pg_statio_all_tables</primary></indexterm>
+ </entry>
<entry>
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See <link linkend="monitoring-pg-statio-all-tables-view">
- <structname>pg_statio_all_tables</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_tables</structname><indexterm><primary>pg_statio_sys_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_sys_tables</structname></link>
+ <indexterm><primary>pg_statio_sys_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_tables</structname><indexterm><primary>pg_statio_user_tables</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-tables-view"><structname>pg_statio_user_tables</structname></link>
+ <indexterm><primary>pg_statio_user_tables</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_tables</structname>, except that only
user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_indexes</structname><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_all_indexes</structname></link>
+ <indexterm><primary>pg_statio_all_indexes</primary></indexterm>
+ </entry>
<entry>
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See <link linkend="monitoring-pg-statio-all-indexes-view">
- <structname>pg_statio_all_indexes</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_indexes</structname><indexterm><primary>pg_statio_sys_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_sys_indexes</structname></link>
+ <indexterm><primary>pg_statio_sys_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on system tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_user_indexes</structname><indexterm><primary>pg_statio_user_indexes</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-indexes-view"><structname>pg_statio_user_indexes</structname></link>
+ <indexterm><primary>pg_statio_user_indexes</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_indexes</structname>, except that only
indexes on user tables are shown.</entry>
</row>
<row>
- <entry><structname>pg_statio_all_sequences</structname><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_all_sequences</structname></link>
+ <indexterm><primary>pg_statio_all_sequences</primary></indexterm>
+ </entry>
<entry>
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See <link linkend="monitoring-pg-statio-all-sequences-view">
- <structname>pg_statio_all_sequences</structname></link> for details.
</entry>
</row>
<row>
- <entry><structname>pg_statio_sys_sequences</structname><indexterm><primary>pg_statio_sys_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_sys_sequences</structname></link>
+ <indexterm><primary>pg_statio_sys_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
system sequences are shown. (Presently, no system sequences are defined,
so this view is always empty.)</entry>
</row>
<row>
- <entry><structname>pg_statio_user_sequences</structname><indexterm><primary>pg_statio_user_sequences</primary></indexterm></entry>
+ <entry>
+ <link linkend="pg-statio-all-sequences-view"><structname>pg_statio_user_sequences</structname></link>
+ <indexterm><primary>pg_statio_user_sequences</primary></indexterm>
+ </entry>
<entry>Same as <structname>pg_statio_all_sequences</structname>, except that only
user sequences are shown.</entry>
</row>
@@ -3149,7 +3221,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<primary>pg_stat_subscription</primary>
</indexterm>
- <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
+ <table id="pg-stat-subscription-view" xreflabel="pg_stat_subscription">
<title><structname>pg_stat_subscription</structname> View</title>
<tgroup cols="1">
<thead>
@@ -3265,7 +3337,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
one row per subscription.
</para>
- <table id="pg-stat-subscription-stats" xreflabel="pg_stat_subscription_stats">
+ <table id="pg-stat-subscription-stats-view" xreflabel="pg_stat_subscription_stats">
<title><structname>pg_stat_subscription_stats</structname> View</title>
<tgroup cols="1">
<thead>
--
1.8.3.1
On 08.12.22 03:30, Peter Smith wrote:
PSA patches for v9*
v9-0001 - Now the table rows are ordered per PeterE's suggestions [1]
committed
v9-0002 - All the review comments from DavidJ [2] are addressed
I'm not sure about this one. It removes the "see [link] for details"
phrases and instead makes the view name a link. I think this loses the
cue that there is more information elsewhere. Otherwise, one could
think that, say, the entry about pg_stat_activity is the primary source
and the link just links to itself. Also keep in mind that people use
media where links are not that apparent (PDF), so the presence of a link
by itself cannot be the only cue about the flow of the information.
On Mon, 2 Jan 2023 at 13:47, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
On 08.12.22 03:30, Peter Smith wrote:
PSA patches for v9*
v9-0001 - Now the table rows are ordered per PeterE's suggestions [1]
committed
v9-0002 - All the review comments from DavidJ [2] are addressed
I'm not sure about this one. It removes the "see [link] for details"
phrases and instead makes the view name a link. I think this loses the
cue that there is more information elsewhere. Otherwise, one could
think that, say, the entry about pg_stat_activity is the primary source
and the link just links to itself. Also keep in mind that people use
media where links are not that apparent (PDF), so the presence of a link
by itself cannot be the only cue about the flow of the information.
I'm not sure if anything is pending for v9-0003, if there is something
pending, please post an updated patch for the same.
Regards,
Vignesh
On Wed, Jan 4, 2023 at 6:08 PM vignesh C <vignesh21@gmail.com> wrote:
On Mon, 2 Jan 2023 at 13:47, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:On 08.12.22 03:30, Peter Smith wrote:
PSA patches for v9*
v9-0001 - Now the table rows are ordered per PeterE's suggestions [1]
committed
Thanks for pushing.
v9-0002 - All the review comments from DavidJ [2] are addressed
I'm not sure about this one. It removes the "see [link] for details"
phrases and instead makes the view name a link. I think this loses the
cue that there is more information elsewhere. Otherwise, one could
think that, say, the entry about pg_stat_activity is the primary source
and the link just links to itself. Also keep in mind that people use
media where links are not that apparent (PDF), so the presence of a link
by itself cannot be the only cue about the flow of the information.
PSA new patch for v10-0001
v9-0001 --> pushed, thanks!
v9-0002 --> I removed this based on the reject reason above
v9-0003 --> v10-0001
I'm not sure if anything is pending for v9-0003, if there is something
pending, please post an updated patch for the same.
Thanks for the reminder. PSA v10.
------
Kind Regards,
Peter Smith.
Fujitsu Australia
Attachments:
v10-0001-Add-Statistics-Views-section-and-refentry-for-ea.patchapplication/octet-stream; name=v10-0001-Add-Statistics-Views-section-and-refentry-for-ea.patchDownload
From 84632b35e65ef803eb32eadfce3d363a13891cb1 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 11 Jan 2023 16:51:56 +1100
Subject: [PATCH v10] Add "Statistics Views" section and refentry for each
view.
---
doc/src/sgml/monitoring.sgml | 257 ++++++++++++++++++++++++++++++++-----------
1 file changed, 194 insertions(+), 63 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 358d2ff..c222b53 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -290,6 +290,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
linkend="predefined-roles"/>) can see all the information about all sessions.
</para>
+ </sect2>
+
+ <sect2 id="monitoring-stats-views-all">
+ <title>Statistics Views</title>
+
<table id="monitoring-stats-dynamic-views-table">
<title>Dynamic Statistics Views</title>
@@ -681,10 +686,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
into the kernel's handling of I/O.
</para>
- </sect2>
+ <refentry id="monitoring-pg-stat-activity-view">
+ <refnamediv>
+ <refname><structname>pg_stat_activity</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-activity-view">
- <title><structname>pg_stat_activity</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_activity</primary>
@@ -2343,10 +2352,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</programlisting>
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-view">
- <title><structname>pg_stat_replication</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication</primary>
@@ -2680,10 +2695,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-replication-slots-view">
+ <refnamediv>
+ <refname><structname>pg_stat_replication_slots</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-replication-slots-view">
- <title><structname>pg_stat_replication_slots</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_replication_slots</primary>
@@ -2829,10 +2850,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-receiver-view">
- <title><structname>pg_stat_wal_receiver</structname></title>
+ <refentry id="monitoring-pg-stat-wal-receiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal_receiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal_receiver</primary>
@@ -3009,10 +3036,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-recovery-prefetch">
- <title><structname>pg_stat_recovery_prefetch</structname></title>
+ <refentry id="monitoring-pg-stat-recovery-prefetch">
+ <refnamediv>
+ <refname><structname>pg_stat_recovery_prefetch</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_recovery_prefetch</primary>
@@ -3155,10 +3188,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription">
- <title><structname>pg_stat_subscription</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription</primary>
@@ -3266,10 +3305,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-subscription-stats">
+ <refnamediv>
+ <refname><structname>pg_stat_subscription_stats</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-subscription-stats">
- <title><structname>pg_stat_subscription_stats</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_subscription_stats</primary>
@@ -3344,10 +3389,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-ssl-view">
- <title><structname>pg_stat_ssl</structname></title>
+ <refentry id="monitoring-pg-stat-ssl-view">
+ <refnamediv>
+ <refname><structname>pg_stat_ssl</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_ssl</primary>
@@ -3465,10 +3516,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-gssapi-view">
+ <refnamediv>
+ <refname><structname>pg_stat_gssapi</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-gssapi-view">
- <title><structname>pg_stat_gssapi</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_gssapi</primary>
@@ -3540,10 +3597,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-archiver-view">
+ <refnamediv>
+ <refname><structname>pg_stat_archiver</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-archiver-view">
- <title><structname>pg_stat_archiver</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_archiver</primary>
@@ -3644,10 +3707,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
archived.
</para>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-bgwriter-view">
+ <refnamediv>
+ <refname><structname>pg_stat_bgwriter</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-bgwriter-view">
- <title><structname>pg_stat_bgwriter</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_bgwriter</primary>
@@ -3781,10 +3850,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-wal-view">
- <title><structname>pg_stat_wal</structname></title>
+ <refentry id="monitoring-pg-stat-wal-view">
+ <refnamediv>
+ <refname><structname>pg_stat_wal</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_wal</primary>
@@ -3915,10 +3990,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
-</sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-database-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-database-view">
- <title><structname>pg_stat_database</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database</primary>
@@ -4240,10 +4321,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-database-conflicts-view">
- <title><structname>pg_stat_database_conflicts</structname></title>
+ <refentry id="monitoring-pg-stat-database-conflicts-view">
+ <refnamediv>
+ <refname><structname>pg_stat_database_conflicts</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_database_conflicts</primary>
@@ -4343,10 +4430,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-tables-view">
- <title><structname>pg_stat_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_tables</primary>
@@ -4614,10 +4707,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_stat_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-all-indexes-view">
- <title><structname>pg_stat_all_indexes</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_all_indexes</primary>
@@ -4763,10 +4862,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</para>
</note>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-tables-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_tables</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-tables-view">
- <title><structname>pg_statio_all_tables</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_tables</primary>
@@ -4899,10 +5004,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-statio-all-indexes-view">
- <title><structname>pg_statio_all_indexes</structname></title>
+ <refentry id="monitoring-pg-statio-all-indexes-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_indexes</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_indexes</primary>
@@ -4999,10 +5110,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-statio-all-sequences-view">
+ <refnamediv>
+ <refname><structname>pg_statio_all_sequences</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-statio-all-sequences-view">
- <title><structname>pg_statio_all_sequences</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_statio_all_sequences</primary>
@@ -5077,10 +5194,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
+
+ <refentry id="monitoring-pg-stat-user-functions-view">
+ <refnamediv>
+ <refname><structname>pg_stat_user_functions</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
- <sect2 id="monitoring-pg-stat-user-functions-view">
- <title><structname>pg_stat_user_functions</structname></title>
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>pg_stat_user_functions</primary>
@@ -5167,10 +5290,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
- </sect2>
+ </refsect1></refentry>
- <sect2 id="monitoring-pg-stat-slru-view">
- <title><structname>pg_stat_slru</structname></title>
+ <refentry id="monitoring-pg-stat-slru-view">
+ <refnamediv>
+ <refname><structname>pg_stat_slru</structname></refname>
+ <refpurpose>View</refpurpose>
+ </refnamediv>
+
+ <refsect1>
+ <title>Description</title>
<indexterm>
<primary>SLRU</primary>
@@ -5289,6 +5418,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</tgroup>
</table>
+ </refsect1></refentry>
+
</sect2>
<sect2 id="monitoring-stats-functions">
--
1.8.3.1
On 11.01.23 07:11, Peter Smith wrote:
v9-0003 --> v10-0001
I'm not sure if anything is pending for v9-0003, if there is something
pending, please post an updated patch for the same.Thanks for the reminder. PSA v10.
So this patch changes some sections describing system views to
refentry's. What is the reason for that? refentry's are basically man
pages; do we want man pages for each system view?
Maybe (*), but then we should also do the same to all the other system
views, all the system catalogs, everything else. Just changing a few in
a single place seems odd.
(*) -- but also maybe not?
On Wed, Jan 18, 2023 at 3:36 AM Peter Eisentraut <
peter.eisentraut@enterprisedb.com> wrote:
On 11.01.23 07:11, Peter Smith wrote:
v9-0003 --> v10-0001
I'm not sure if anything is pending for v9-0003, if there is something
pending, please post an updated patch for the same.Thanks for the reminder. PSA v10.
So this patch changes some sections describing system views to
refentry's. What is the reason for that? refentry's are basically man
pages; do we want man pages for each system view?
I didn't really consider the effect this might have on man pages. I knew
it would produce the desired effect in the HTML and assumed it would
produce an acceptable effect in the PDF. I was going for the html effect
of having these views chunked into their own pages, any other changes being
non-detrimental. And inspecting the DocBook configurations learned that
sect1 and refentry had this effect. Using sect1 is not possible in this
part of the documentation.
Maybe (*), but then we should also do the same to all the other system
views, all the system catalogs, everything else. Just changing a few in
a single place seems odd.(*) -- but also maybe not?
I could see those who use man pages being pleased with having access to
these core building blocks of the system at ready access. I am not one of
those people, using the website exclusively. If there is a champion of man
pages here that wants to ensure that changes in this area work well there
this patch would be better for it.
I really want a one-page-per-view output on the website in this section.
This is the only way I could see getting to that point (as noted upthread,
system catalogs don't have this problem because they are able to be
marked up as sect1) . The existing side-effect is, for me, an acceptable
trade-off situation. If you want to provide a statement for why these are
special, it's because they are in the System Monitoring chapter instead of
System Internals and the man pages don't cover system internals...
I'm not opposed to alternative markup that gets the pagination job done,
though it likely involves tool-chain configuration/modifications. There is
a nearby thread where this is being done presently so maybe if refentry is
a commit-blocker there is still hope, but it is presently outside my
capability. I'm after the pagination and have no current preference as to
how it is technically accomplished.
David J.
"David G. Johnston" <david.g.johnston@gmail.com> writes:
... I was going for the html effect
of having these views chunked into their own pages, any other changes being
non-detrimental.
But is that a result we want? It will for example break any bookmarks
that people might have for these documentation entries. It will also
pretty thoroughly break the cross-version navigation links in this
part of the docs.
Maybe the benefit is worth those costs, but I'm entirely not convinced
of that. I think we need to tread pretty lightly when rearranging
longstanding documentation-layout decisions.
regards, tom lane
On Wed, Jan 18, 2023 at 8:38 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
... I was going for the html effect
of having these views chunked into their own pages, any other changesbeing
non-detrimental.
But is that a result we want? It will for example break any bookmarks
that people might have for these documentation entries. It will also
pretty thoroughly break the cross-version navigation links in this
part of the docs.
Maybe the benefit is worth those costs, but I'm entirely not convinced
of that. I think we need to tread pretty lightly when rearranging
longstanding documentation-layout decisions.
Fair points.
The external linking can be solved with redirect rules, as I believe we've
done before, and fairly recently. Even if not I think when they see why
the break happened they will be happy for the improved user experience.
I do think it is important enough a change to warrant breaking the
cross-version navigation links. I can imagine a linking scheme that would
still work but I'm doubtful that this is important enough to expend the
development effort.
David J.
On Thu, Jan 19, 2023 at 2:55 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:
On Wed, Jan 18, 2023 at 8:38 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
... I was going for the html effect
of having these views chunked into their own pages, any other changes being
non-detrimental.But is that a result we want? It will for example break any bookmarks
that people might have for these documentation entries. It will also
pretty thoroughly break the cross-version navigation links in this
part of the docs.Maybe the benefit is worth those costs, but I'm entirely not convinced
of that. I think we need to tread pretty lightly when rearranging
longstanding documentation-layout decisions.
David already gave a good summary [1]DJ overview - /messages/by-id/CAKFQuwaVm=6d_sw9Wrp4cdSm5_k=8ZVx0--v2v4BH4KnJtqXqg@mail.gmail.com, but since I was the OP here is
the background of v10-0001 from my PoV.
~
The original $SUBJECT requirements evolved to also try to make each
view appear on a separate page after that was suggested by DavidJ [2]DJ suggested view-per-page - /messages/by-id/CAKFQuwa9JtoCBVc6CJb7NC5FqMeEAy_A8X4H8t6kVaw7fz9LTw@mail.gmail.com.
I was unable to achieve per-page views "without radically changing the
document structure." [3]PS don't know how to do it - /messages/by-id/CAHut+Pv5Efz1TLWOLSoFvoyC0mq+s92yFSd534ctWSdjEFtKCw@mail.gmail.com, but DavidJ found a way [4]DJ how to do it using refentry - /messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com to do it using
refentry. I then wrote the patch v8-0003 using that strategy, which
after more rebasing became the v10-0001 you see today.
I did prefer the view-per-page results (although I also only use HTML
docs). But my worry is that there seem still to be a few unknowns
about how this might affect other (not the HTML) renderings of the
docs. If you think that risk is too great, or if you feel this patch
will cause unwarranted link/bookmark grief, then I am happy to just
drop it.
------
[1]: DJ overview - /messages/by-id/CAKFQuwaVm=6d_sw9Wrp4cdSm5_k=8ZVx0--v2v4BH4KnJtqXqg@mail.gmail.com
/messages/by-id/CAKFQuwaVm=6d_sw9Wrp4cdSm5_k=8ZVx0--v2v4BH4KnJtqXqg@mail.gmail.com
[2]: DJ suggested view-per-page - /messages/by-id/CAKFQuwa9JtoCBVc6CJb7NC5FqMeEAy_A8X4H8t6kVaw7fz9LTw@mail.gmail.com
/messages/by-id/CAKFQuwa9JtoCBVc6CJb7NC5FqMeEAy_A8X4H8t6kVaw7fz9LTw@mail.gmail.com
[3]: PS don't know how to do it - /messages/by-id/CAHut+Pv5Efz1TLWOLSoFvoyC0mq+s92yFSd534ctWSdjEFtKCw@mail.gmail.com
/messages/by-id/CAHut+Pv5Efz1TLWOLSoFvoyC0mq+s92yFSd534ctWSdjEFtKCw@mail.gmail.com
[4]: DJ how to do it using refentry - /messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com
/messages/by-id/CAKFQuwYkM5UZT+6tG+NgZvDcd5VavS+xNHsGsWC8jS-KJsxh7w@mail.gmail.com
Kind Regards,
Peter Smith.
Fujitsu Australia
On 19.01.23 00:45, Peter Smith wrote:
The original $SUBJECT requirements evolved to also try to make each
view appear on a separate page after that was suggested by DavidJ [2].
I was unable to achieve per-page views "without radically changing the
document structure." [3], but DavidJ found a way [4] to do it using
refentry. I then wrote the patch v8-0003 using that strategy, which
after more rebasing became the v10-0001 you see today.I did prefer the view-per-page results (although I also only use HTML
docs). But my worry is that there seem still to be a few unknowns
about how this might affect other (not the HTML) renderings of the
docs. If you think that risk is too great, or if you feel this patch
will cause unwarranted link/bookmark grief, then I am happy to just
drop it.
I'm wary of making semantic markup changes to achieve an ad-hoc
presentation effects. Sometimes it's necessary, but it should be
considered carefully and globally.
We could change the chunking boundary to be sect2 globally. This is
easily configurable (chunk.section.depth).
Thinking about it now, maybe this is what we need. As the documentation
grows, as it clearly does, the depth of the structure increases and
pages get longer. This can also be seen in other chapters.
Of course, this would need to be tested and checked in more detail.
On Fri, Jan 27, 2023 at 10:30 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
On 19.01.23 00:45, Peter Smith wrote:
The original $SUBJECT requirements evolved to also try to make each
view appear on a separate page after that was suggested by DavidJ [2].
I was unable to achieve per-page views "without radically changing the
document structure." [3], but DavidJ found a way [4] to do it using
refentry. I then wrote the patch v8-0003 using that strategy, which
after more rebasing became the v10-0001 you see today.I did prefer the view-per-page results (although I also only use HTML
docs). But my worry is that there seem still to be a few unknowns
about how this might affect other (not the HTML) renderings of the
docs. If you think that risk is too great, or if you feel this patch
will cause unwarranted link/bookmark grief, then I am happy to just
drop it.I'm wary of making semantic markup changes to achieve an ad-hoc
presentation effects. Sometimes it's necessary, but it should be
considered carefully and globally.We could change the chunking boundary to be sect2 globally. This is
easily configurable (chunk.section.depth).Thinking about it now, maybe this is what we need. As the documentation
grows, as it clearly does, the depth of the structure increases and
pages get longer. This can also be seen in other chapters.Of course, this would need to be tested and checked in more detail.
This chunk configuration idea sounds a better approach. If somebody
else wants to champion that change separately then I can maybe help to
review it.
Meanwhile, this pagination topic has strayed far away from the
original $SUBJECT, so I guess since there is nothing else pending this
thread's CF entry [1]https://commitfest.postgresql.org/41/3904/ can just be marked as "Committed" now?
------
[1]: https://commitfest.postgresql.org/41/3904/
Kind Regards,
Peter Smith.
Fujitsu Australia
On 30.01.23 07:12, Peter Smith wrote:
Meanwhile, this pagination topic has strayed far away from the
original $SUBJECT, so I guess since there is nothing else pending this
thread's CF entry [1] can just be marked as "Committed" now?
done
On 2023-Jan-30, Peter Smith wrote:
On Fri, Jan 27, 2023 at 10:30 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
We could change the chunking boundary to be sect2 globally. This is
easily configurable (chunk.section.depth).
Thinking about it now, maybe this is what we need. As the documentation
grows, as it clearly does, the depth of the structure increases and
pages get longer. This can also be seen in other chapters.
This chunk configuration idea sounds a better approach. If somebody
else wants to champion that change separately then I can maybe help to
review it.
Changing the chunking depth will change every single doc URL, though, so
the website will need some work to ensure there's a good transition
mechanism for the "this page in older/newer versions" functionality.
It sounds doable, but someone will need to craft it and test it. (Maybe
it would work to populate a table with all URLs at each side of the
divide, and its equivalent at the other side.)
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/