Query plan regression post-load
Your task
MySQL 8 (InnoDB). A reporting endpoint that has run in ~120 ms for months suddenly p99'd to 9 s starting at 02:10. No deploy went out. The slow query is a 3-table join filtered on a recently-bulk-loaded orders partition. EXPLAIN now shows a full table scan + nested loop where it used to use a covering index, and rows estimates are off by ~1000x. A large overnight bulk import finished at 02:05. Triage and mitigate, then make it not recur.
It covers
- Stats staleness
- Plan flip
- Estimation error