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

