Why MySQL Optimizer Picks the Wrong Index and How to Fix It
The MySQL optimizer can select an inappropriate index due to inaccurate statistics or sampling errors, but you can correct this by refreshing statistics with ANALYZE TABLE, increasing sample pages, or explicitly forcing the right index using the FORCE INDEX hint.
