Home Explore Blog CI



postgresql

72th chunk of `doc/src/sgml/monitoring.sgml`
7a842439b72b90486880da2e02ca8882d571cef637b2a3330000000100000fa9
      <structfield>tuples_done</structfield> <type>bigint</type>
      </para>
      <para>
       Number of tuples already processed in the current phase.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partitions_total</structfield> <type>bigint</type>
      </para>
      <para>
       Total number of partitions on which the index is to be created
       or attached, including both direct and indirect partitions.
       <literal>0</literal> during a <literal>REINDEX</literal>, or when
       the index is not partitioned.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partitions_done</structfield> <type>bigint</type>
      </para>
      <para>
       Number of partitions on which the index has already been created
       or attached, including both direct and indirect partitions.
       <literal>0</literal> during a <literal>REINDEX</literal>, or when
       the index is not partitioned.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <table id="create-index-phases">
   <title>CREATE INDEX 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>CREATE INDEX</command> or <command>REINDEX</command> is preparing to create the index.  This
       phase is expected to be very brief.
      </entry>
     </row>
     <row>
      <entry><literal>waiting for writers before build</literal></entry>
      <entry>
       <command>CREATE INDEX CONCURRENTLY</command> or <command>REINDEX CONCURRENTLY</command> is waiting for transactions
       with write locks that can potentially see the table to finish.
       This phase is skipped when not in concurrent mode.
       Columns <structname>lockers_total</structname>, <structname>lockers_done</structname>
       and <structname>current_locker_pid</structname> contain the progress
       information for this phase.
      </entry>
     </row>
     <row>
      <entry><literal>building index</literal></entry>
      <entry>
       The index is being built by the access method-specific code.  In this phase,
       access methods that support progress reporting fill in their own progress data,
       and the subphase is indicated in this column.  Typically,
       <structname>blocks_total</structname> and <structname>blocks_done</structname>
       will contain progress data, as well as potentially
       <structname>tuples_total</structname> and <structname>tuples_done</structname>.
      </entry>
     </row>
     <row>
      <entry><literal>waiting for writers before validation</literal></entry>
      <entry>
       <command>CREATE INDEX CONCURRENTLY</command> or <command>REINDEX CONCURRENTLY</command> is waiting for transactions
       with write locks that can potentially write into the table to finish.
       This phase is skipped when not in concurrent mode.
       Columns <structname>lockers_total</structname>, <structname>lockers_done</structname>
       and <structname>current_locker_pid</structname> contain the progress
       information for this phase.
      </entry>
     </row>
     <row>
      <entry><literal>index validation: scanning index</literal></entry>
      <entry>
       <command>CREATE INDEX CONCURRENTLY</command> is scanning the index searching
       for tuples that need to be validated.
       This phase is skipped when not in concurrent mode.
       Columns <structname>blocks_total</structname> (set to the total size of the index)
       and <structname>blocks_done</structname> contain the progress information for this phase.
      </entry>
     </row>
     <row>
      <entry><literal>index validation:

Title: pg_stat_progress_create_index View Details (Completion) and CREATE INDEX Phases
Summary
This section concludes the description of the `pg_stat_progress_create_index` view columns, focusing on `partitions_total` and `partitions_done` which track the progress of index creation/attachment on partitioned tables. It then transitions to detailing the various phases of the `CREATE INDEX` process, which include 'initializing', 'waiting for writers before build', 'building index', 'waiting for writers before validation', and 'index validation: scanning index', describing what happens during each phase and which columns provide progress information.