查看sql查询是否用到索引(mysql)
2020-09-23 本文已影响0人
手捧樱花v
我们只需要注意一个最重要的type 的信息很明显的提现是否用到索引:
type结果值从好到坏依次是:
system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL
一般来说,得保证查询至少达到range级别,最好能达到ref,否则就可能会出现性能问题。
![](https://img.haomeiwen.com/i12694553/60f841bfb456af24.png)