如何判断是否自动清理守护进程在Postgres 9.x中是运行和维护数据库集群的吗?
PostgreSQL 9.3
确定 Autovacuum 是否正在运行
这是 UNIX 上的 Postgres 9.3 特有的。
对于 Windows,请参阅此question https://stackoverflow.com/q/2027046/41906.
查询Postgres系统表
SELECT
schemaname, relname,
last_vacuum, last_autovacuum,
vacuum_count, autovacuum_count -- not available on 9.0 and earlier
FROM pg_stat_user_tables;
Grep 系统进程状态
$ ps -axww | grep autovacuum
24352 ?? Ss 1:05.33 postgres: autovacuum launcher process (postgres)
Grep Postgres 日志
# grep autovacuum /var/log/postgresql
LOG: autovacuum launcher started
LOG: autovacuum launcher shutting down
如果您想了解更多关于自动真空活动、设置log_min_messages
to DEBUG1..DEBUG5
。 SQL 命令VACUUM VERBOSE
会输出日志级别的信息INFO
.
关于 Autovacuum 守护进程,Postgres 文档指出:
在默认配置中,启用自动清理并适当设置相关配置参数。
也可以看看:
- http://www.postgresql.org/docs/current/static/routine-vacuuming.html http://www.postgresql.org/docs/current/static/routine-vacuuming.html
- http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)