1. 业务低峰期optimize table回收一下表空间然后执行analyze table <表名重新统计表空间然后在执行sql 看下执行计划是否正常。
2.
开启一下optimizer_trace获取一下数据
SET optimizer_trace="enabled=on";
SELECT ...; # your query here
SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
# possibly more queries...
# When done with tracing, disable it:
SET optimizer_trace="enabled=off";
3.
explain执行计划检查。