更新时间:2026-03-23 GMT+08:00
PG_AUTOVAC_STATUS
通过该函数查看某表是否达到了AUTOVACUUM阈值,通常需要关注返回结果中的doanalyze和dovacuum两个值。视图各字段定义如下:
名称 | 类型 | 描述 |
|---|---|---|
nspname | text | 名称空间名称。 |
relname | text | 表、索引、视图等对象名称。 |
nodename | text | 节点名称。 |
doanalyze | Boolean | 是否执行analyze。 |
anltuples | bigint | analyze tuple数量。 |
anlthresh | bigint | analyze阈值。 |
dovacuum | Boolean | 是否执行vacuum。 |
vactuples | bigint | vacuum tuple数量。 |
vacthresh | bigint | vacuum阈值。 |
执行结果如下:
gaussdb=# select * from pg_autovac_status('t2'::regclass);
nspname | relname | nodename | doanalyze | anltuples | anlthresh | dovacuum | vactuples | vacthresh
---------+---------+----------+-----------+-----------+-----------+----------+-----------+-----------
public | t2 | sgnode | f | 0 | 2050 | t | 15002 | 4050
(1 row) 父主题:VACUUM

