GaussDB(DWS)系统表清理指南
GaussDB(DWS)系统表清理指南
系统表由于长时间运行会不断累积,尤其是大量的创建对象(表、视图等)和删除对象更会造成系统表膨胀,系统表膨胀后可能会导致查询性能降低,需要进行垃圾数据清理。清理命令如下:
omm用户连接cn执行如下sql进行清理
VACUUM FULL PG_ATTRIBUTE;
VACUUM FULL PG_CLASS;
VACUUM FULL PG_CONSTRAINT;
VACUUM FULL PG_DATABASE;
VACUUM FULL PG_PARTITION;
VACUUM FULL PG_PROC;
VACUUM FULL PG_STAT_USER_INDEXES;
VACUUM FULL PG_STAT_USER_TABLES;
VACUUM FULL PG_STATISTIC;
VACUUM FULL PG_STATS;
ANALYZE PG_ATTRIBUTE;
ANALYZE PG_CLASS;
ANALYZE PG_CONSTRAINT;
ANALYZE PG_DATABASE;
ANALYZE PG_PARTITION;
ANALYZE PG_PROC;
ANALYZE PG_STAT_USER_INDEXES;
ANALYZE PG_STAT_USER_TABLES;
ANALYZE PG_STATISTIC;
ANALYZE PG_STATS;
注意:
1、系统表清理会锁系统表,需在业务低峰期且没有DDL操作时执行;
2、这些系统表是database级别的,需要对每个database执行一遍,或针对明确有膨胀的database执行。
- 点赞
- 收藏
- 关注作者
评论(0)