postgresql autovacuum not working although process is running postgresql autovacuum not working although process is running postgresql postgresql

postgresql autovacuum not working although process is running


The relevant entry in the quoted configuration is probably:

autovacuum_vacuum_scale_factor = 0.2

With this default, it's normal that autovacuum skips a table if less than 20% of its rows have been deleted or updated (or less than autovacuum_vacuum_threshold rows but at 128 that shouldn't matter here).

See its definition in the documentation:

autovacuum_vacuum_scale_factor (floating point)

Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM. The default is 0.2 (20% of table size). This parameter can only be set in the postgresql.conf file or on the server command line. This setting can be overridden for individual tables by changing storage parameters.

To have autovacuum process certain tables if you don't like the defaults, you may lower this parameter on a case by case basis. For example to set it at 1%:

ALTER TABLE tablename SET (autovacuum_vacuum_scale_factor=0.01);