PostgreSQL 10.0 preview 功能增强 - QUERY进度显示

1 minute read



PostgreSQL 10.0将在内核层面增加一个这样的支持。

首先会在analye命令上尝试,但是它会设计为通用的视图,支持其他命令,诸如CREATE INDEX, VAUUM, CLUSTER等。

Hello Hackers,  
Following is a proposal for reporting the progress of ANALYZE command:  
It seems that the following could be the phases of ANALYZE processing:  
1. Collecting sample rows  
2. Collecting inherited sample rows  
3. Computing heap stats  
4. Computing index stats  
5. Cleaning up indexes  
The first phase is easy if there is no inheritance but in case of   
inheritance we need to sample the blocks from multiple heaps.  
Here the progress is counted against total number of blocks processed.  
The view provides the information of analyze command progress details as   
postgres=# \d pg_stat_progress_analyze  
           View "pg_catalog.pg_stat_progress_analyze"  
       Column       |  Type   | Collation | Nullable | Default  
  pid               | integer |           |          |  
  datid             | oid     |           |          |  
  datname           | name    |           |          |  
  relid             | oid     |           |          |  
  phase             | text    |           |          |  
  heap_blks_total   | bigint  |           |          |  
  heap_blks_scanned | bigint  |           |          |  
  total_sample_rows | bigint  |           |          |  
I feel this view information may be useful in checking the progress of   
long running ANALYZE command.  
The attached patch reports the different phases of analyze command.  
Added this patch to CF 2017-03.  
Note: Collecting inherited sample rows phase is not reported yet in the   
Vinayak Pokale  
NTT Open Source Software Center  




《官人要杯咖啡吗? - PostgreSQL实时监测PLAN tree的执行进度 - pg_query_state》

Flag Counter

digoal’s 大量PostgreSQL文章入口