Restructure doc sections about statistics views
authorMagnus Hagander
Sun, 16 Nov 2014 12:47:44 +0000 (13:47 +0100)
committerMagnus Hagander
Sun, 16 Nov 2014 12:49:03 +0000 (13:49 +0100)
Break out the "dynamic statistics" views in the table from the
"collected statistics" ones. Could do with some more refactoring,
but this is a start.

doc/src/sgml/monitoring.sgml

index 354165bf083058d232f71362815723a3c8dedd5e..b29e5e60726bb2a10639c87e656757e80b7ded60 100644 (file)
@@ -147,9 +147,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
   
 
   
-   PostgreSQL also supports reporting of the exact
-   command currently being executed by other server processes.  This
-   facility is independent of the collector process.
+   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 collector process.
   
 
  
@@ -211,18 +213,21 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
  
 
  
-  Viewing <span class="marked">Collected </span>Statistics
+  Viewing Statistics
 
   
    Several predefined views, listed in 
-   linkend="monitoring-stats-views-table">, are available to show the results
+   linkend="monitoring-stats-dynamic-views-table">, are available to show
+   the current state of the system. There are also several other
+   views, listed in 
+   linkend="monitoring-stats-views-table">, available to show the results
    of statistics collection.  Alternatively, one can
    build custom views using the underlying statistics functions, as discussed
    in .
   
 
   
-   When using the statistics to monitor current activity, it is important
+   When using the statistics to monitor collected data, it is important
    to realize that the information does not update instantaneously.
    Each individual server process transmits new statistical counts to
    the collector just before going idle; so a query or transaction still in
@@ -263,8 +268,8 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
    stated above; instead they update continuously throughout the transaction.
   
 
-  
-   <span class="marked">Standard</span> Statistics Views
+  dynamic-views-table">
+   <span class="marked">Dynamic</span> Statistics Views
 
    
     
@@ -287,6 +292,30 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
       
      
 
+     
+      pg_stat_replicationpg_stat_replication
+      One row per WAL sender process, showing statistics about
+       replication to that sender's connected standby server.
+       See  for details.
+      
+     
+
+    
+   
+  
+
+  
+   Collected Statistics Views
+
+   
+    
+     
+      View Name
+      Description
+     
+    
+
+    
      
       pg_stat_archiverpg_stat_archiver
       One row only, showing statistics about the
@@ -310,6 +339,15 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
       
      
 
+     
+      pg_stat_database_conflictspg_stat_database_conflicts
+      
+       One row per database, showing database-wide statistics about
+       query cancels due to conflict with recovery on standby servers.
+       See  for details.
+      
+     
+
      
       pg_stat_all_tablespg_stat_all_tables
       
@@ -453,23 +491,6 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
       yet included in pg_stat_user_functions).
      
 
-     
-      pg_stat_replicationpg_stat_replication
-      One row per WAL sender process, showing statistics about
-       replication to that sender's connected standby server.
-       See  for details.
-      
-     
-
-     
-      pg_stat_database_conflictspg_stat_database_conflicts
-      
-       One row per database, showing database-wide statistics about
-       query cancels due to conflict with recovery on standby servers.
-       See  for details.
-      
-     
-
     
    
   
@@ -684,6 +705,127 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
    
   
 
+  
+   <structname>pg_stat_replication</structname> View
+   
+    
+    
+      Column
+      Type
+      Description
+     
+    
+
+   
+    
+     pid
+     integer
+     Process ID of a WAL sender process
+    
+    
+     usesysid
+     oid
+     OID of the user logged into this WAL sender process
+    
+    
+     usename
+     name
+     Name of the user logged into this WAL sender process
+    
+    
+     application_name
+     text
+     Name of the application that is connected
+      to this WAL sender
+    
+    
+     client_addr
+     inet
+     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.
+     
+    
+    
+     client_hostname
+     text
+     Host name of the connected client, as reported by a
+      reverse DNS lookup of client_addr. This field will
+      only be non-null for IP connections, and only when 
+      linkend="guc-log-hostname"> is enabled.
+     
+    
+    
+     client_port
+     integer
+     TCP port number that the client is using for communication
+      with this WAL sender, or -1 if a Unix socket is used
+     
+    
+    
+     backend_start
+     timestamp with time zone
+     Time when this process was started, i.e., when the
+      client connected to this WAL sender
+     
+    
+    
+     backend_xmin
+     xid
+     This standby's xmin horizon reported
+     by .
+    
+    
+     state
+     text
+     Current WAL sender state
+    
+    
+     sent_location
+     pg_lsn
+     Last transaction log position sent on this connection
+    
+    
+     write_location
+     pg_lsn
+     Last transaction log position written to disk by this standby
+      server
+    
+    
+     flush_location
+     pg_lsn
+     Last transaction log position flushed to disk by this standby
+      server
+    
+    
+     replay_location
+     pg_lsn
+     Last transaction log position replayed into the database on this
+      standby server
+    
+    
+     sync_priority
+     integer
+     Priority of this standby server for being chosen as the
+      synchronous standby
+    
+    
+     sync_state
+     text
+     Synchronous state of this standby server
+    
+   
+   
+  
+
+  
+   The pg_stat_replication 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.
+  
+
+
   
    <structname>pg_stat_archiver</structname> View
 
@@ -965,6 +1107,70 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
    for each database in the cluster, showing database-wide statistics.
   
 
+  
+   <structname>pg_stat_database_conflicts</structname> View
+   
+    
+    
+      Column
+      Type
+      Description
+     
+    
+
+   
+    
+     datid
+     oid
+     OID of a database
+    
+    
+     datname
+     name
+     Name of this database
+    
+    
+     confl_tablespace
+     bigint
+     Number of queries in this database that have been canceled due to
+      dropped tablespaces
+    
+    
+     confl_lock
+     bigint
+     Number of queries in this database that have been canceled due to
+      lock timeouts
+    
+    
+     confl_snapshot
+     bigint
+     Number of queries in this database that have been canceled due to
+      old snapshots
+    
+    
+     confl_bufferpin
+     bigint
+     Number of queries in this database that have been canceled due to
+      pinned buffers
+    
+    
+     confl_deadlock
+     bigint
+     Number of queries in this database that have been canceled due to
+      deadlocks
+    
+   
+   
+  
+
+  
+   The pg_stat_database_conflicts 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 master servers.
+  
+
   
    <structname>pg_stat_all_tables</structname> View
    
@@ -1445,190 +1651,6 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
    controls exactly which functions are tracked.
   
 
-  
-   <structname>pg_stat_replication</structname> View
-   
-    
-    
-      Column
-      Type
-      Description
-     
-    
-
-   
-    
-     pid
-     integer
-     Process ID of a WAL sender process
-    
-    
-     usesysid
-     oid
-     OID of the user logged into this WAL sender process
-    
-    
-     usename
-     name
-     Name of the user logged into this WAL sender process
-    
-    
-     application_name
-     text
-     Name of the application that is connected
-      to this WAL sender
-    
-    
-     client_addr
-     inet
-     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.
-     
-    
-    
-     client_hostname
-     text
-     Host name of the connected client, as reported by a
-      reverse DNS lookup of client_addr. This field will
-      only be non-null for IP connections, and only when 
-      linkend="guc-log-hostname"> is enabled.
-     
-    
-    
-     client_port
-     integer
-     TCP port number that the client is using for communication
-      with this WAL sender, or -1 if a Unix socket is used
-     
-    
-    
-     backend_start
-     timestamp with time zone
-     Time when this process was started, i.e., when the
-      client connected to this WAL sender
-     
-    
-    
-     backend_xmin
-     xid
-     This standby's xmin horizon reported
-     by .
-    
-    
-     state
-     text
-     Current WAL sender state
-    
-    
-     sent_location
-     pg_lsn
-     Last transaction log position sent on this connection
-    
-    
-     write_location
-     pg_lsn
-     Last transaction log position written to disk by this standby
-      server
-    
-    
-     flush_location
-     pg_lsn
-     Last transaction log position flushed to disk by this standby
-      server
-    
-    
-     replay_location
-     pg_lsn
-     Last transaction log position replayed into the database on this
-      standby server
-    
-    
-     sync_priority
-     integer
-     Priority of this standby server for being chosen as the
-      synchronous standby
-    
-    
-     sync_state
-     text
-     Synchronous state of this standby server
-    
-   
-   
-  
-
-  
-   The pg_stat_replication 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.
-  
-
-  
-   <structname>pg_stat_database_conflicts</structname> View
-   
-    
-    
-      Column
-      Type
-      Description
-     
-    
-
-   
-    
-     datid
-     oid
-     OID of a database
-    
-    
-     datname
-     name
-     Name of this database
-    
-    
-     confl_tablespace
-     bigint
-     Number of queries in this database that have been canceled due to
-      dropped tablespaces
-    
-    
-     confl_lock
-     bigint
-     Number of queries in this database that have been canceled due to
-      lock timeouts
-    
-    
-     confl_snapshot
-     bigint
-     Number of queries in this database that have been canceled due to
-      old snapshots
-    
-    
-     confl_bufferpin
-     bigint
-     Number of queries in this database that have been canceled due to
-      pinned buffers
-    
-    
-     confl_deadlock
-     bigint
-     Number of queries in this database that have been canceled due to
-      deadlocks
-    
-   
-   
-  
-
-  
-   The pg_stat_database_conflicts 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 master servers.
-  
-