a.分析SQL的执行计划 explain,可以模拟SQL优化器执行SQL语句
b.MySQL的查询优化会干扰我们的优化
查询优化计划:
explain +SQL语句;
explain select * from shine;
id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra
id :编号
select_type :查询类型
table :表
type :类型
possible_keys :预测用到的索引
key :实际上用到的索引
key_len :实际上使用索引的长度
ref :表之间的引用
rows :通过索引查询到的数据量
Extra:额外的信息