pg_stat_progress_analyze

ANALYZE 命令的进度报告视图

pg_stat_progress_analyze 是一个 进度报告视图,提供有关 ANALYZE 命令进度的信息。

pg_stat_progress_analyzePostgreSQL 13 中添加。

用法

delay_timePostgreSQL 18 及更高版本)仅在 track_cost_delay_timing 设置为 on 时才会被更新。

按 PostgreSQL 版本定义

pg_stat_progress_analyze (PostgreSQL 19)

                  View "pg_catalog.pg_stat_progress_analyze"
          Column           |       Type       | Collation | Nullable | Default 
---------------------------+------------------+-----------+----------+---------
 pid                       | integer          |           |          | 
 datid                     | oid              |           |          | 
 datname                   | name             |           |          | 
 relid                     | oid              |           |          | 
 phase                     | text             |           |          | 
 sample_blks_total         | bigint           |           |          | 
 sample_blks_scanned       | bigint           |           |          | 
 ext_stats_total           | bigint           |           |          | 
 ext_stats_computed        | bigint           |           |          | 
 child_tables_total        | bigint           |           |          | 
 child_tables_done         | bigint           |           |          | 
 current_child_table_relid | oid              |           |          | 
 delay_time                | double precision |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 18)

                  View "pg_catalog.pg_stat_progress_analyze"
          Column           |       Type       | Collation | Nullable | Default 
---------------------------+------------------+-----------+----------+---------
 pid                       | integer          |           |          | 
 datid                     | oid              |           |          | 
 datname                   | name             |           |          | 
 relid                     | oid              |           |          | 
 phase                     | text             |           |          | 
 sample_blks_total         | bigint           |           |          | 
 sample_blks_scanned       | bigint           |           |          | 
 ext_stats_total           | bigint           |           |          | 
 ext_stats_computed        | bigint           |           |          | 
 child_tables_total        | bigint           |           |          | 
 child_tables_done         | bigint           |           |          | 
 current_child_table_relid | oid              |           |          | 
 delay_time                | double precision |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 17)

              View "pg_catalog.pg_stat_progress_analyze"
          Column           |  Type   | Collation | Nullable | Default 
---------------------------+---------+-----------+----------+---------
 pid                       | integer |           |          | 
 datid                     | oid     |           |          | 
 datname                   | name    |           |          | 
 relid                     | oid     |           |          | 
 phase                     | text    |           |          | 
 sample_blks_total         | bigint  |           |          | 
 sample_blks_scanned       | bigint  |           |          | 
 ext_stats_total           | bigint  |           |          | 
 ext_stats_computed        | bigint  |           |          | 
 child_tables_total        | bigint  |           |          | 
 child_tables_done         | bigint  |           |          | 
 current_child_table_relid | oid     |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 16)

              View "pg_catalog.pg_stat_progress_analyze"
          Column           |  Type   | Collation | Nullable | Default 
---------------------------+---------+-----------+----------+---------
 pid                       | integer |           |          | 
 datid                     | oid     |           |          | 
 datname                   | name    |           |          | 
 relid                     | oid     |           |          | 
 phase                     | text    |           |          | 
 sample_blks_total         | bigint  |           |          | 
 sample_blks_scanned       | bigint  |           |          | 
 ext_stats_total           | bigint  |           |          | 
 ext_stats_computed        | bigint  |           |          | 
 child_tables_total        | bigint  |           |          | 
 child_tables_done         | bigint  |           |          | 
 current_child_table_relid | oid     |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 15)

              View "pg_catalog.pg_stat_progress_analyze"
          Column           |  Type   | Collation | Nullable | Default 
---------------------------+---------+-----------+----------+---------
 pid                       | integer |           |          | 
 datid                     | oid     |           |          | 
 datname                   | name    |           |          | 
 relid                     | oid     |           |          | 
 phase                     | text    |           |          | 
 sample_blks_total         | bigint  |           |          | 
 sample_blks_scanned       | bigint  |           |          | 
 ext_stats_total           | bigint  |           |          | 
 ext_stats_computed        | bigint  |           |          | 
 child_tables_total        | bigint  |           |          | 
 child_tables_done         | bigint  |           |          | 
 current_child_table_relid | oid     |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 14)

              View "pg_catalog.pg_stat_progress_analyze"
          Column           |  Type   | Collation | Nullable | Default 
---------------------------+---------+-----------+----------+---------
 pid                       | integer |           |          | 
 datid                     | oid     |           |          | 
 datname                   | name    |           |          | 
 relid                     | oid     |           |          | 
 phase                     | text    |           |          | 
 sample_blks_total         | bigint  |           |          | 
 sample_blks_scanned       | bigint  |           |          | 
 ext_stats_total           | bigint  |           |          | 
 ext_stats_computed        | bigint  |           |          | 
 child_tables_total        | bigint  |           |          | 
 child_tables_done         | bigint  |           |          | 
 current_child_table_relid | oid     |           |          |
    

文档: pg_stat_progress_analyze

pg_stat_progress_analyze (PostgreSQL 13)

              View "pg_catalog.pg_stat_progress_analyze"
          Column           |  Type   | Collation | Nullable | Default 
---------------------------+---------+-----------+----------+---------
 pid                       | integer |           |          | 
 datid                     | oid     |           |          | 
 datname                   | name    |           |          | 
 relid                     | oid     |           |          | 
 phase                     | text    |           |          | 
 sample_blks_total         | bigint  |           |          | 
 sample_blks_scanned       | bigint  |           |          | 
 ext_stats_total           | bigint  |           |          | 
 ext_stats_computed        | bigint  |           |          | 
 child_tables_total        | bigint  |           |          | 
 child_tables_done         | bigint  |           |          | 
 current_child_table_relid | oid     |           |          |
    

文档: pg_stat_progress_analyze

变更历史

示例

正在进行的 ANALYZE 操作期间的 pg_stat_progress_analyze 输出示例

postgres=# SELECT * FROM pg_stat_progress_analyze;
-[ RECORD 1 ]-------------+----------------------
pid                       | 29956
datid                     | 12692
datname                   | postgres
relid                     | 16384
phase                     | acquiring sample rows
sample_blks_total         | 30000
sample_blks_scanned       | 12544
ext_stats_total           | 0
ext_stats_computed        | 0
child_tables_total        | 0
child_tables_done         | 0
current_child_table_relid | 0

分类

监控, 进度报告视图

另请参阅

ANALYZE, 进度报告, track_cost_delay_timing, pg_stat_progress_vacuum

反馈

在此 提交有关“pg_stat_progress_analyze”的任何评论、建议或更正。