I have a pg_toast table which has a lot of dead tuples accumulating. The autovacuum job on it runs for a very long time.
I wanted to tune the autovacuum config, to make it more aggressive.
When i’m trying to set the config I get the following error:
ERROR: permission denied: "pg_toast_16432" is a system catalog
Query used:
ALTER TABLE pg_toast.pg_toast_16432 SET (autovacuum_vacuum_scale_factor = 0);
Postgres version: 11
Can someone please suggest how to tune autoconfig on toast tables?
2
Answers
You can set a storage parameter on the table itself, as described in the documentation. If the table is called
tab
, runNote that setting
autovacuum_vacuum_scale_factor
to 0 won’t do what you want. To speed up autovacuum, increaseautovacuum_vacuum_cost_limit
or reduceautovacuum_vacuum_cost_delay
.You cannot directly modify the autovacuum configuration for individual system catalog tables, however, you can consider using other performance optimization techniques like indexing and query optimization to reduce the need for aggressive autovacuuming.