Memory cards
Estimates decide the plan; bad estimates ruin it
confidence: highupdated: 2026-11-25status: activedatabasecardinalityplanner
Claim#
Histograms and stats predict rows. A correlated predicate or a stale stat produces a 1-row guess for 1M rows.
Test#
Compare EXPLAIN estimate with actual. Update stats. Test a correlated predicate.
Proof#
An estimate within an order of magnitude and a better plan.
Failure modes#
An estimate that is wrong by 1000x picks a nested loop. Sampling helps, correlation does not.