Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法测量PostgreSQL 中的逻辑复制滞后?
你可以检查一下pg_catalog.pg_replication_slots。在主(发布者)服务器上运行此代码:
pg_catalog.pg_replication_slots
SELECT slot_name, confirmed_flush_lsn, pg_current_wal_lsn(), (pg_current_wal_lsn() - confirmed_flush_lsn) AS lsn_distance FROM pg_replication_slots;
lsn_distance是复制滞后的度量。
lsn_distance