postgresql_16:4.13.4.1 ANALYZE Progress Reporting
PostgreSQL 16 > Server Administration > Monitoring Database Activity > Progress Reporting > ANALYZE Progress Reporting
Whenever ANALYZE is running, the pg_stat_progress_analyze view will contain a row for each backend that is currently running that command. The tables below describe the information that will be reported and provide information about how to interpret it.
| Column Type Description | | --- | | pid integer Process ID of backend. | | datid oid OID of the database to which this backend is connected. | | datname name Name of the database to which this backend is connected. | | relid oid OID of the table being analyzed. | | phase text Current processing phase. See (see analyze-phases). | | sample_blks_total bigint Total number of heap blocks that will be sampled. | | sample_blks_scanned bigint Number of heap blocks scanned. | | ext_stats_total bigint Number of extended statistics. | | ext_stats_computed bigint Number of extended statistics computed. This counter only advances when the phase is computing extended statistics. | | child_tables_total bigint Number of child tables. | | child_tables_done bigint Number of child tables scanned. This counter only advances when the phase is acquiring inherited sample rows. | | current_child_table_relid oid OID of the child table currently being scanned. This field is only valid when the phase is acquiring inherited sample rows. |
| Phase | Description | | --- | --- | | initializing | The command is preparing to begin scanning the heap. This phase is expected to be very brief. | | acquiring sample rows | The command is currently scanning the table given by relid to obtain sample rows. | | acquiring inherited sample rows | The command is currently scanning child tables to obtain sample rows. Columns child_tables_total, child_tables_done, and current_child_table_relid contain the progress information for this phase. | | computing statistics | The command is computing statistics from the sample rows obtained during the table scan. | | computing extended statistics | The command is computing extended statistics from the sample rows obtained during the table scan. | | finalizing analyze | The command is updating pg_class. When this phase is completed, ANALYZE will end. |
Note
Note that when ANALYZE is run on a partitioned table, all of its partitions are also recursively analyzed. In that case, ANALYZE progress is reported first for the parent table, whereby its inheritance statistics are collected, followed by that for each partition.