pg_stat_wal
是一个显示有关WAL 活动信息的统计视图。
pg_stat_wal
在PostgreSQL 14 中添加。
按 PostgreSQL 版本定义
pg_stat_wal (PostgreSQL 17)
View "pg_catalog.pg_stat_wal" Column | Type | Collation | Nullable | Default ------------------+--------------------------+-----------+----------+--------- wal_records | bigint | | | wal_fpi | bigint | | | wal_bytes | numeric | | | wal_buffers_full | bigint | | | wal_write | bigint | | | wal_sync | bigint | | | wal_write_time | double precision | | | wal_sync_time | double precision | | | stats_reset | timestamp with time zone | | |
文档: pg_stat_wal
pg_stat_wal (PostgreSQL 16)
View "pg_catalog.pg_stat_wal" Column | Type | Collation | Nullable | Default ------------------+--------------------------+-----------+----------+--------- wal_records | bigint | | | wal_fpi | bigint | | | wal_bytes | numeric | | | wal_buffers_full | bigint | | | wal_write | bigint | | | wal_sync | bigint | | | wal_write_time | double precision | | | wal_sync_time | double precision | | | stats_reset | timestamp with time zone | | |
文档: pg_stat_wal
pg_stat_wal (PostgreSQL 15)
View "pg_catalog.pg_stat_wal" Column | Type | Collation | Nullable | Default ------------------+--------------------------+-----------+----------+--------- wal_records | bigint | | | wal_fpi | bigint | | | wal_bytes | numeric | | | wal_buffers_full | bigint | | | wal_write | bigint | | | wal_sync | bigint | | | wal_write_time | double precision | | | wal_sync_time | double precision | | | stats_reset | timestamp with time zone | | |
文档: pg_stat_wal
pg_stat_wal (PostgreSQL 14)
View "pg_catalog.pg_stat_wal" Column | Type | Collation | Nullable | Default ------------------+--------------------------+-----------+----------+--------- wal_records | bigint | | | wal_fpi | bigint | | | wal_bytes | numeric | | | wal_buffers_full | bigint | | | wal_write | bigint | | | wal_sync | bigint | | | wal_write_time | double precision | | | wal_sync_time | double precision | | | stats_reset | timestamp with time zone | | |
文档: pg_stat_wal
变更历史
- PostgreSQL 14
- 添加(初始提交 8d9a9359)
示例
postgres=# SELECT * FROM pg_stat_wal\gx -[ RECORD 1 ]----+------------------------------ wal_records | 1387 wal_fpi | 110 wal_bytes | 659600 wal_buffers_full | 0 wal_write | 14 wal_sync | 0 wal_write_time | 0 wal_sync_time | 0 stats_reset | 2021-03-09 10:06:01.842869+01
参考文献
- PostgreSQL 文档: pg_stat_wal
另请参阅
wal_buffers,track_wal_io_timing