pg_stat_progress_analyze 是一个 进度报告视图,提供有关 ANALYZE 命令进度的信息。
pg_stat_progress_analyze 在 PostgreSQL 13 中添加。
用法
列 delay_time(PostgreSQL 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 (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 (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 (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 (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 (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 (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 | | |
变更历史
- PostgreSQL 18
- 添加了列
delay_time(提交 bb8dff99)
- 添加了列
- PostgreSQL 13
- 添加于 (提交 a166d408)
示例
正在进行的 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
参考资料
- PostgreSQL 文档: ANALYZE 进度报告
