pg_stat_replication_slots

一个统计视图,显示有关逻辑复制槽使用情况的统计信息

pg_stat_replication_slots 是一个 统计视图,显示有关逻辑复制槽使用情况的统计信息,特别是有关从 ReorderBuffer 溢出到磁盘的事务。

pg_stat_replication_slotsPostgreSQL 14 中添加。

重置统计信息

可以通过调用函数 pg_stat_reset_replication_slot(slot_name) 重置特定逻辑复制槽的统计信息。

可以通过调用 pg_stat_reset_replication_slot(NULL) 重置所有逻辑复制槽的统计信息。

按 PostgreSQL 版本定义

pg_stat_replication_slots (PostgreSQL 17)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

文档: pg_stat_replication_slots

pg_stat_replication_slots (PostgreSQL 16)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

文档: pg_stat_replication_slots

pg_stat_replication_slots (PostgreSQL 15)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

文档: pg_stat_replication_slots

pg_stat_replication_slots (PostgreSQL 14)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

文档: pg_stat_replication_slots

更改历史记录

示例

订阅正在同步时 pg_stat_replication_slots 的示例内容

postgres=# SELECT * FROM pg_stat_replication_slots\gx
-[ RECORD 1 ]+-----------------------------------------
slot_name    | test_subscription
spill_txns   | 0
spill_count  | 0
spill_bytes  | 0
stream_txns  | 0
stream_count | 0
stream_bytes | 0
total_txns   | 0
total_bytes  | 0
stats_reset  | 
-[ RECORD 2 ]+-----------------------------------------
slot_name    | pg_131705_sync_16417_7036528642179786015
spill_txns   | 0
spill_count  | 0
spill_bytes  | 0
stream_txns  | 0
stream_count | 0
stream_bytes | 0
total_txns   | 0
total_bytes  | 0
stats_reset  | 

分类

逻辑复制复制复制槽统计/监控视图

另请参阅

pg_stat_reset_replication_slot()

反馈

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