Introduction

After teams learn that VACUUM is normal, the next assumption is simple: “Autovacuum will handle it automatically.” That belief works well in small systems. In real production environments, it often breaks down.

Many engineers first notice this when performance gets worse after autovacuum activity increases. CPU stays high. Disk I/O looks busy all the time. Tables still bloat. At that point, autovacuum feels like it is doing damage instead of helping.

This article explains why autovacuum can make performance worse, what teams usually see in production, and why default settings quietly fail as systems grow.

What Autovacuum Is Supposed to Do

Autovacuum is PostgreSQL’s background worker that decides when to run VACUUM and how aggressively to run it. Its job is to prevent dead rows from piling up without requiring manual intervention.

Think of autovacuum like an automatic cleaning robot in a busy office. If the office is small, one robot works fine. As the office grows and people move faster, the same robot either runs constantly or misses entire areas.

Autovacuum doesn’t understand your business logic. It reacts only to row counts, thresholds, and time.

Why Autovacuum Can Make Performance Worse

Autovacuum becomes harmful when it is forced to work under pressure.

This usually happens when:

When autovacuum finally triggers, it runs aggressively to catch up. That aggressive cleanup competes directly with live queries.

From the application side, nothing changed. From the database side, a backlog exploded.

What Developers Usually See in Production

Teams often notice the following patterns:

The confusing part is that autovacuum appears “healthy” because it is running. But the system still feels slow.

Why This Feels Sudden and Counterintuitive

Autovacuum is reactive, not proactive.

Dead rows accumulate silently until a threshold is crossed. Once crossed, cleanup starts. If the table is large, cleanup takes time. If traffic continues, cleanup never finishes.

This creates a loop:

To engineers, it feels like autovacuum caused the problem. In reality, it exposed a scaling limit.

The “Default Settings” Trap

PostgreSQL defaults are designed to be safe for small workloads. They are not designed for high-write production systems.

Common misconceptions:

In practice, defaults often trigger cleanup too late and too aggressively. That timing is what hurts performance.

Real-World Example

A payments system updates transaction rows frequently. Initially, everything works fine. As traffic grows, update volume increases. Autovacuum does not run often enough because thresholds are still based on percentages.

When cleanup finally starts, it scans huge tables during peak load. Latency spikes. Engineers blame queries, indexes, or the cloud provider.

The real issue is that autovacuum was allowed to fall behind.

Advantages and Disadvantages of Autovacuum Behavior

Advantages (When Tuned and Monitored)

When autovacuum is configured correctly:

Autovacuum becomes invisible, which is the goal.

Disadvantages (When Left Untuned)

When teams rely blindly on defaults:

At that stage, autovacuum feels like a liability.

How Teams Should Think About This

Autovacuum is not a magic safety net. It is a control system with assumptions.

Teams should stop asking, “Is autovacuum on?” and start asking:

Autovacuum should reduce risk, not create surprises.

Simple Mental Checklist

When autovacuum feels harmful, check:

These questions usually point to the real issue quickly.

Summary

Autovacuum makes PostgreSQL safer, but only when its assumptions match reality. In growing production systems, default settings often delay cleanup until it becomes disruptive. When autovacuum appears to hurt performance, it is usually revealing a workload that has outgrown its configuration. Teams that understand this treat autovacuum as a system to tune and observe, not a feature to blindly trust.