Database Optimization Tool
Maintenance audit

Postgres stale statistics check for bad plan risk

Database Optimization Tool reviews last_analyze and last_autoanalyze evidence so teams can decide whether stale planner statistics deserve manual analyze review.

last_analyze
last_autoanalyze
Bad plan risk
ANALYZE planning guidance

What the collector reads

The collector can include last_analyze, last_autoanalyze, estimated live rows, estimated dead rows, scan counts, relation size, and query statistics when available. Those signals help rank stale statistics candidates.

Why stale statistics matter

PostgreSQL plans depend on row estimates. If a table changes heavily and analyze timestamps are stale, bad plan risk rises, especially when scan pressure, slow queries, or row-estimate drift appear nearby.

Evidence-gated review

Old timestamps are not enough by themselves. Database Optimization Tool treats stale statistics as evidence-gated review material and avoids claiming a planner problem without supporting signals.

Manual analyze review

The workflow ANALYZE planning guidance, change autovacuum settings, or schedule maintenance. Engineers decide whether manual ANALYZE, autovacuum tuning, or deeper EXPLAIN review is appropriate.

Keep exploring

Use these short guides to compare query pressure, index decisions, and maintenance signals before planning production work.

FAQ

Frequently asked questions

These answers describe the product focus: careful database evidence, clear findings, and team-approved next steps.

Does Database Optimization Tool run ANALYZE?

No. It ANALYZE planning guidance or any production maintenance command. It reports evidence so the database owner can decide the next step.

Is an old last_analyze value always a defect?

No. A small stable table may not need frequent analyze. Risk increases when old last_analyze or last_autoanalyze values align with table churn, scan pressure, or query latency.

How does this differ from an autovacuum check?

This page focuses on planner statistics freshness and bad plan risk. Autovacuum health also considers dead rows, vacuum history, bloat signals, and maintenance drift.

What should I verify after a stale statistics finding?

Review table changes, compare estimates with EXPLAIN, check query impact, and decide whether a manual ANALYZE or autovacuum settings review is justified.