Tuning Autovacuum Parameters

Autovacuum is a scheduling process that runs VACUUM workers that process dead tuples. The workers are triggered based on configurable threshold values.

Generally speaking, as your workload increases, particularly update and delete operations for tables, you’ll want to modify the Autovacuum thresholds so that it runs more.

Specifically, your goal is to make it run more frequently. When it does run, you also want it to run for a longer amount of time before putting itself to sleep.

You may also want it to run more jobs in parallel when you have a lot of tables since it schedules one job per table. You want to add more memory, and you’ll want it to run parallel workers for partitioned tables, which is something you’ll ...

Get High Performance PostgreSQL for Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.