MariaDB ANALYZE FORMAT=JSON: When the Optimizer's Row Estimates Lie to You
The report query took 40 ms every day except Mondays, when it took 41 seconds. EXPLAIN showed the identical plan both days. ANALYZE showed the truth: one node estimated 900 rows and actually read 1.8 million of them on Monday's skewed data.