我如何知道PostgreSQL的Autovacuum是否在UNIX上运行?

前端之家收集整理的这篇文章主要介绍了我如何知道PostgreSQL的Autovacuum是否在UNIX上运行?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何告诉Postgres 9.x中的autovacuum守护进程是否正在运行和维护数据库集群?
Postgresql 9.3

确定Autovacuum是否正在运行

这是特定于UNIX上的Postgres 9.3。
对于Windows,请参阅此question

查询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 Log

# grep autovacuum /var/log/postgresql
LOG:  autovacuum launcher started
LOG:  autovacuum launcher shutting down

如果您想了解有关autovacuum活动的更多信息,请将log_min_messages设置为DEBUG1..DEBUG5。 sql命令VACUUM VERBOSE将在日志级别INFO输出信息。

关于Autovacuum守护程序,Posgres docs状态:

In the default configuration,autovacuuming is enabled and the related configuration parameters are appropriately set.

也可以看看:

> http://www.postgresql.org/docs/current/static/routine-vacuuming.html
> http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html

原文链接:https://www.f2er.com/postgresql/193296.html

猜你在找的Postgre SQL相关文章