pg_stat_checkpointer

显示检查点信息的视图

pg_stat_checkpointer 是一个 系统统计视图,显示有关 检查点 的信息。

pg_stat_checkpointerPostgreSQL 17 中添加,其中包含先前包含在 pg_stat_bgwriter 中的一些信息。

统计重置

可以通过执行以下命令重置 pg_stat_checkpointer 显示的统计信息:

SELECT pg_stat_reset_shared('checkpointer')

按PostgreSQL版本定义

pg_stat_checkpointer (PostgreSQL 18)

                     View "pg_catalog.pg_stat_checkpointer"
       Column        |           Type           | Collation | Nullable | Default 
---------------------+--------------------------+-----------+----------+---------
 num_timed           | bigint                   |           |          | 
 num_requested       | bigint                   |           |          | 
 num_done            | bigint                   |           |          | 
 restartpoints_timed | bigint                   |           |          | 
 restartpoints_req   | bigint                   |           |          | 
 restartpoints_done  | bigint                   |           |          | 
 write_time          | double precision         |           |          | 
 sync_time           | double precision         |           |          | 
 buffers_written     | bigint                   |           |          | 
 slru_written        | bigint                   |           |          | 
 stats_reset         | timestamp with time zone |           |          |
    

文档: pg_stat_checkpointer

pg_stat_checkpointer (PostgreSQL 17)

                     View "pg_catalog.pg_stat_checkpointer"
       Column        |           Type           | Collation | Nullable | Default 
---------------------+--------------------------+-----------+----------+---------
 num_timed           | bigint                   |           |          | 
 num_requested       | bigint                   |           |          | 
 restartpoints_timed | bigint                   |           |          | 
 restartpoints_req   | bigint                   |           |          | 
 restartpoints_done  | bigint                   |           |          | 
 write_time          | double precision         |           |          | 
 sync_time           | double precision         |           |          | 
 buffers_written     | bigint                   |           |          | 
 stats_reset         | timestamp with time zone |           |          |
    

文档: pg_stat_checkpointer

更改历史

示例

pg_stat_checkpointer 的基本用法示例

postgres=# SELECT * FROM pg_stat_checkpointer;
 num_timed | num_requested | write_time | sync_time | buffers_written |          stats_reset          
-----------+---------------+------------+-----------+-----------------+-------------------------------
         1 |             1 |       4514 |         2 |              76 | 2023-10-31 10:31:48.064606+09
(1 row)


postgres=# CHECKPOINT;
CHECKPOINT

postgres=# SELECT * FROM pg_stat_checkpointer;
 num_timed | num_requested | write_time | sync_time | buffers_written |          stats_reset          
-----------+---------------+------------+-----------+-----------------+-------------------------------
         1 |             2 |       4516 |         3 |              76 | 2023-10-31 10:31:48.064606+09
(1 row)

重置 pg_stat_checkpointer 统计信息

postgres=# SELECT pg_stat_reset_shared('checkpointer');
 pg_stat_reset_shared 
----------------------
 
(1 row)

postgres=# SELECT * FROM pg_stat_checkpointer;
 num_timed | num_requested | write_time | sync_time | buffers_written |          stats_reset          
-----------+---------------+------------+-----------+-----------------+-------------------------------
         0 |             0 |          0 |         0 |               0 | 2023-10-31 10:48:28.553766+09
(1 row)

分类

统计/监控视图系统目录

另请参见

pg_stat_bgwriter

反馈

请在此提交关于 "pg_stat_checkpointer" 的任何评论、建议或更正 此处