如何判断autovacuum daemon名博士后是否为9人.x正在运行和维护数据库群集?

推荐答案

PostgreSQL 9.3

确定自动真空系统是否正在运行

这是针对UNIX上的Postgres 9.3的.

查询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将以日志(log)级别INFO输出信息.


关于Autovacuum守护程序,Posgres文档声明:

在默认配置中,会启用自动抽真空,并适当设置相关配置参数.

另见:

Postgresql相关问答推荐

使用regexp获取表名

为MCV扩展统计设置统计目标

GORM Golang SQL查询执行不区分大小写的搜索不起作用

Postgres如何插入带有十进制逗号的实数?

将具有自定义类型的表从一种模式复制到另一种模式

如何使用 go-pg 包删除所有记录

gitlab在ubuntu上安装duplicate schema问题

Postgres 生成的列不是不可变的

如何在postgresql中按时间查询

Postgres 查询计划器不会使用更便宜的复合索引

Postgres - 如何加入两列?

获取 OperationalError: FATAL: sorry, too many clients already using psycopg2

!= 和 <> 运算符有什么区别?

冲突中的 Postgres 会更新复合主键

如何在 psycopg2 中使用服务器端游标

无法登录 PostgreSQL 数据库

错误:CASE types character varying and numeric cannot be matched

用于更改 postgresql 用户密码的 bash 脚本

向 Postgres 整数数组添加值

在 Flask-sqlalchemy 和 Postgresql 中使用 JSON 类型