Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why does autovacuum not vacuum my table?

There is one table in my schema that does not get autovacuumed. If I run VACUUM posts; on the table the vacuum process finishes nicely, but the autovacuum daemon never vacuums the table for some reason. Is there a way to find out why? What could be possible reasons for this?

table stats

like image 292
Simon Avatar asked Mar 06 '23 00:03

Simon


1 Answers

That is just fine, nothing to worry.

The table is the only medium sized one (3 million rows).

Autovacuum will kick in if the number of dead tuples more than autovacuum_vacuum_scale_factor (default: 0.2) of your live tuples, so if more than 20% of your table has been deleted or updated.

This is usually just fine, and I would not change it. But if you want to do it for some reason, you can do it like this:

ALTER TABLE posts SET (autovacuum_vacuum_scale_factor = 0.1); 
like image 99
Laurenz Albe Avatar answered Mar 19 '23 16:03

Laurenz Albe