Summary
Whenever CREATE INDEX or REINDEX is running, the pg_stat_progress_create_index view will contain one row for each backend that is currently creating indexes. The tables below describe the information that will be reported and provide information about how to interpret it.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_stat_progress_create_index statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
pidinteger
Process ID of the backend creating indexes.datidoid
OID of the database to which this backend is connected.datnamename
Name of the database to which this backend is connected.relidoid
OID of the table on which the index is being created.index_relidoid
OID of the index being created or reindexed. During a non-concurrent CREATE INDEX, this is 0.commandtext
Specific command type: CREATE INDEX, CREATE INDEX CONCURRENTLY, REINDEX, or REINDEX CONCURRENTLY.phasetext
Current processing phase of index creation. See create_index_phases.lockers_totalbigint
Total number of lockers to wait for, when applicable.lockers_donebigint
Number of lockers already waited for.current_locker_pidbigint
Process ID of the locker currently being waited for.blocks_totalbigint
Total number of blocks to be processed in the current phase.blocks_donebigint
Number of blocks already processed in the current phase.tuples_totalbigint
Total number of tuples to be processed in the current phase.tuples_donebigint
Number of tuples already processed in the current phase.partitions_totalbigint
Total number of partitions on which the index is to be created or attached, including both direct and indirect partitions. 0 during a REINDEX, or when the index is not partitioned.partitions_donebigint
Number of partitions on which the index has already been created or attached, including both direct and indirect partitions. 0 during a REINDEX, or when the index is not partitioned.
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_stat_progress_create_index.