Home Explore Blog CI



postgresql

36th chunk of `doc/src/sgml/monitoring.sgml`
cc1ee07c56e664a6133b0b61730849b6369d00f82a3e48c10000000100000fa6
 <varname>context</varname>s.
       </para>
      </entry>
     </row>

     <row>
      <entry role="catalog_table_entry">
       <para role="column_definition">
        <structfield>fsyncs</structfield> <type>bigint</type>
       </para>
       <para>
        Number of <literal>fsync</literal> calls. These are only tracked in
        <varname>context</varname> <literal>normal</literal>.
       </para>
      </entry>
     </row>

     <row>
      <entry role="catalog_table_entry">
       <para role="column_definition">
        <structfield>fsync_time</structfield> <type>double precision</type>
       </para>
       <para>
        Time spent waiting for fsync operations in milliseconds (if
        <xref linkend="guc-track-io-timing"/> is enabled and
        <varname>object</varname> is not <literal>wal</literal>,
        or if <xref linkend="guc-track-wal-io-timing"/> is enabled
        and <varname>object</varname> is <literal>wal</literal>,
        otherwise zero)
       </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>

  <para>
   Some backend types never perform I/O operations on some I/O objects and/or
   in some I/O contexts. These rows are omitted from the view. For example, the
   checkpointer does not checkpoint temporary tables, so there will be no rows
   for <varname>backend_type</varname> <literal>checkpointer</literal> and
   <varname>object</varname> <literal>temp relation</literal>.
  </para>

  <para>
   In addition, some I/O operations will never be performed either by certain
   backend types or on certain I/O objects and/or in certain I/O contexts.
   These cells will be NULL. For example, temporary tables are not
   <literal>fsync</literal>ed, so <varname>fsyncs</varname> will be NULL for
   <varname>object</varname> <literal>temp relation</literal>. Also, the
   background writer does not perform reads, so <varname>reads</varname> will
   be NULL in rows for <varname>backend_type</varname> <literal>background
   writer</literal>.
  </para>

  <para>
   For the <varname>object</varname> <literal>wal</literal>,
   <varname>fsyncs</varname> and <varname>fsync_time</varname> track the
   fsync activity of WAL files done in <function>issue_xlog_fsync</function>.
   <varname>writes</varname> and <varname>write_time</varname>
   track the write activity of WAL files done in
   <function>XLogWrite</function>.
   See <xref linkend="wal-configuration"/> for more information.
  </para>

  <para>
   <structname>pg_stat_io</structname> can be used to inform database tuning.
   For example:
   <itemizedlist>
    <listitem>
     <para>
      A high <varname>evictions</varname> count can indicate that shared
      buffers should be increased.
     </para>
    </listitem>
    <listitem>
     <para>
      Client backends rely on the checkpointer to ensure data is persisted to
      permanent storage. Large numbers of <varname>fsyncs</varname> by
      <literal>client backend</literal>s could indicate a misconfiguration of
      shared buffers or of the checkpointer. More information on configuring
      the checkpointer can be found in <xref linkend="wal-configuration"/>.
     </para>
    </listitem>
    <listitem>
     <para>
      Normally, client backends should be able to rely on auxiliary processes
      like the checkpointer and the background writer to write out dirty data
      as much as possible. Large numbers of writes by client backends could
      indicate a misconfiguration of shared buffers or of the checkpointer.
      More information on configuring the checkpointer can be found in <xref
      linkend="wal-configuration"/>.
     </para>
    </listitem>
   </itemizedlist>
  </para>

  <note>

Title: pg_stat_io View: Fsyncs, Stats Reset, and Usage Notes
Summary
This section completes the description of the `pg_stat_io` view columns, including `fsyncs` (number of fsync calls, tracked only in 'normal' context), `fsync_time` (time spent on fsync operations), and `stats_reset` (time of last statistics reset). It clarifies that some backends or objects may not perform certain I/O operations, resulting in omitted rows or NULL cells. It provides details on WAL-related statistics and offers guidance on using `pg_stat_io` for database tuning, such as identifying shared buffer issues or checkpointer misconfigurations based on eviction and fsync counts.