Middle
What is autovacuum in PostgreSQL?
sobes.tech AI
Answer from AI
Autovacuum in PostgreSQL is an automatic process that handles database cleanup and maintenance. It performs vacuuming (removing dead rows), analyzes tables to update statistics, and prevents database file bloat.
Without autovacuum, tables can quickly grow due to the accumulation of "dead" records after updates and deletions, which degrades performance.
Example configuration of autovacuum in postgresql.conf:
autovacuum = on
autovacuum_naptime = 1min
autovacuum_vacuum_threshold = 50
Autovacuum runs in the background and starts automatically, greatly simplifying PostgreSQL administration.