加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-13 16:43:14 所属栏目:百科 来源:网络整理
导读:如何告诉Postgres 9.x中的autovacuum守护进程是否正在运行和维护数据库集群? PostgreSQL 9.3 确定Autovacuum是否正在运行 这是特定于UNIX上的Postgres 9.3。 对于Windows,请参阅此question。 查询Postgres系统表 SELECT schemaname,relname,last_vacuum,la
如何告诉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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读