Skip to main content

VACUUM & Autovacuum Statistics

The VACUUM & Autovacuum Statistics section analyzes table maintenance activity during the report period. It helps identify tables that are not being vacuumed frequently enough, tables never vacuumed, and tables whose statistics are stale.

AWR Vacuum Stats


Summary Cards

CardDescription
Total VACUUM OperationsTotal manual VACUUM runs + average per day
Total Autovacuum OperationsTotal autovacuum runs + average per day
Total ANALYZE OperationsTotal ANALYZE runs (manual + auto) + average per day
Tables Never VacuumedTables with no VACUUM history — highlighted in orange if > 0

AWR Vacuum Summary Cards


VACUUM Activity Timeline

A line chart showing VACUUM and autovacuum activity over the report period, helping visualize maintenance patterns and identify periods of increased maintenance activity.


Tab 1 — Top Tables by VACUUM Frequency

Tables ranked by total VACUUM frequency during the report period.

ColumnDescription
RankPosition by VACUUM frequency
Table NameSchema and table name
VACUUMTotal manual VACUUM runs
AutovacuumTotal autovacuum runs
FrequencyCombined VACUUM frequency per day
Last VACUUMTimestamp of the last manual VACUUM
Last AutovacuumTimestamp of the last autovacuum run
ANALYZETotal ANALYZE + autoanalyze runs
StatusTable maintenance status badge
ScriptCopy button to generate the VACUUM script

AWR Vacuum Frequency Table

Table Status Values

StatusMeaning
🟢 OKTable is well maintained
🔵 MONITOREDMaintenance frequency is acceptable — continue monitoring
🟠 NEEDS VACUUMTable requires VACUUM soon
🔴 CRITICALTable maintenance is overdue — immediate action required

Tab 2 — Tables Never Vacuumed

This tab is visible only when at least one table has never been vacuumed. It lists all tables with no VACUUM history, ranked by urgency.

ColumnDescription
Table NameSchema and table name
Live TuplesAverage estimated live row count
Dead TuplesAverage estimated dead tuple count
Dead %Percentage of dead tuples — highlighted in orange if ≥ 20%
Mods Since AnalyzeNumber of row modifications since the last ANALYZE
UrgencyPriority level for VACUUM action
ScriptCopy button to generate the VACUUM script

Urgency Levels

UrgencyMeaning
🔴 HIGHTable has significant dead tuples — vacuum immediately
🟠 MEDIUMTable is accumulating dead tuples — vacuum soon
🔵 LOWTable has little activity — monitor
Tables Never Vacuumed

Tables that have never been vacuumed and have high write activity can accumulate bloat rapidly and risk transaction ID wraparound — a critical PostgreSQL failure condition. Run VACUUM ANALYZE on these tables immediately and verify autovacuum is enabled.


Tab 3 — ANALYZE Statistics

Tables ranked by ANALYZE activity, with a focus on tables that need ANALYZE to refresh query planner statistics.

ColumnDescription
Table NameSchema and table name
ANALYZETotal manual ANALYZE runs
AutoanalyzeTotal autoanalyze runs
Last ANALYZETimestamp of the most recent ANALYZE (manual or auto)
Days SinceDays elapsed since the last ANALYZE — highlighted if > 7 days
Mods Since AnalyzeRow modifications since the last ANALYZE — highlighted if > 10,000
Needs ANALYZEYes (orange) if ANALYZE is recommended / No (green) if up to date
ScriptCopy button to generate the ANALYZE script (when needed)

AWR Analyze Stats Table

Why ANALYZE matters

The PostgreSQL query planner uses statistics collected by ANALYZE to choose the best execution plan. Stale statistics (high Mods Since Analyze) lead the planner to make suboptimal decisions, resulting in slow queries. Ensure autoanalyze is enabled and configured appropriately for high-churn tables.


Maintenance Recommendations

Below the tabs, an automated Maintenance Recommendations section groups tables by recommendation type:

  • Category — type of action needed
  • Affected Tables Count — number of tables concerned
  • Message — explanation of the recommendation
  • Affected Tables — list of table names

When no recommendations are generated, a green confirmation message indicates all tables are properly maintained.


Interpretation Guide

High Autovacuum Frequency on the Same Table

A table running autovacuum very frequently indicates high write activity. Consider lowering autovacuum_vacuum_cost_delay for that table or increasing autovacuum_vacuum_scale_factor if the frequency is excessive.

Last VACUUM / Autovacuum Is Very Old

If a table has not been vacuumed for several days despite having write activity, autovacuum thresholds may be too conservative:

ALTER TABLE schema.table_name SET (
autovacuum_vacuum_scale_factor = 0.01,
autovacuum_vacuum_threshold = 100
);

High Mods Since Analyze

Stale statistics degrade query plan quality. Run ANALYZE manually or lower the autoanalyze threshold:

ANALYZE schema.table_name;
-- or adjust threshold:
ALTER TABLE schema.table_name SET (
autovacuum_analyze_scale_factor = 0.01
);

Next Steps