Postgresql – setup table level Autovacuuming on postgres database

autovacuumpostgresqlpostgresql-9.6postgresql-performance

I am trying to setup table level Autovacuuming on postgres database. What all metrices I need to collect and analyze specific to that particular table?
I have to enable autovacuuming on all the tables wherever it is required.(With most inserts/deletes probably). How do I proceed on this?
Thanks

Best Answer

Just leave all the default settings as they are. Autovacuum is enabled by default and will usually do the right thing. In my professional life I find that newbies who are trying to tune the autovacuum parameters usually do more harm than good.

One parameter I'd recommend changing is autovacuum_vacuum_cost_delay, which I would lower to 2ms (which is the default setting from v12 on). That way, you run less risk of having a too lazy autovacuum.

If you ask a more specific question, you can get a more specific answer.