简体   繁体   English

只读副本的真空统计

[英]Vacuum stats on read replica

We have a hot_standby replication configured for our postgresDB, master is for read/write and replica is a read only server.我们为 postgresDB 配置了一个hot_standby复制,master 用于读/写,replica 是只读服务器。

When I try to fetch the dead tuple count on both master and replica (slave) using the following query当我尝试使用以下查询获取主和副本(从属)上的死元组计数时

#########vacuum and analyze stats
SELECT relname,last_autovacuum,last_autoanalyze,autovacuum_count,autoanalyze_count FROM pg_stat_user_tables;
#########vacuum and analyze stats

I got the below data on slave server我在从属服务器上得到了以下数据

MyTestDB=# SELECT relname,last_autovacuum,last_autoanalyze,autovacuum_count,autoanalyze_count FROM pg_stat_user_tables;
              relname              | last_autovacuum | last_autoanalyze | autovacuum_count | autoanalyze_count
-----------------------------------+-----------------+------------------+------------------+-------------------
Table1                             |                  |                  |                0 |                 0
Table2                             |                  |                  |                0 |                 0

Here the question is, does analyze/vacuum applicable for slave server?这里的问题是,analyze/vacuum是否适用于slave server? if so, it should contain some stats like last autovacuum_count, autoanalyze_count?如果是这样,它应该包含一些统计信息,如上次 autovacuum_count、autoanalyze_count?

Note: As per this thread in postgres forum VACUUM and ANALYZE are automatically replicated into slave注意:根据postgres 论坛中的这个帖子,VACUUM 和 ANALYZE 会自动复制到 slave 中

VACUUM and ANALYZE won't run on standby servers (the results of these operations on the primary are replicated along with all other data), so you will never see statistics that show that they have run. VACUUMANALYZE不会在备用服务器上运行(主服务器上的这些操作的结果与所有其他数据一起复制),因此您永远不会看到显示它们已运行的统计信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM