Home Explore Blog CI



postgresql

44th chunk of `doc/src/sgml/monitoring.sgml`
ce0e542c88f4d1319790e92c9f501ad9b3040b06832738660000000100000fa0
 <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>parallel_workers_launched</structfield> <type>bigint</type>
      </para>
      <para>
       Number of parallel workers launched by queries on this database
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
      </para>
      <para>
       Time at which these statistics were last reset
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect2>

 <sect2 id="monitoring-pg-stat-database-conflicts-view">
  <title><structname>pg_stat_database_conflicts</structname></title>

  <indexterm>
   <primary>pg_stat_database_conflicts</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.
  </para>

  <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>
      <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>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>
      </para>
      <para>
       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>confl_lock</structfield> <type>bigint</type>
      </para>
      <para>
       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>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>confl_active_logicalslot</structfield> <type>bigint</type>
      </para>
      <para>
       Number of uses of logical slots in this database that have been
       canceled due to old snapshots or too low a <xref linkend="guc-wal-level"/>
       on the primary
      </para></entry>
     </row>
    </tbody>
   </tgroup>

Title: pg_stat_database_conflicts View: Tracking Query Conflicts on Standby Servers
Summary
This section introduces the `pg_stat_database_conflicts` view, which provides statistics on query cancels occurring due to conflicts during recovery on standby servers. It outlines the columns of the view, including the database OID (`datid`), database name (`datname`), and counts of queries canceled due to various conflict types, such as dropped tablespaces (`confl_tablespace`), lock timeouts (`confl_lock`), old snapshots (`confl_snapshot`), pinned buffers (`confl_bufferpin`), deadlocks (`confl_deadlock`), and active logical slot conflicts (`confl_active_logicalslot`). This view is specific to standby servers as conflicts do not happen on primary servers.