id 当前的select在总的查询中所处的层次,1 主查询;
select_type 查询类型,SIMPLE 没有子查询的简单查询
table 查询所关联的表
type 如何使用连接 ALL 全表扫描
possible_keys 可能会用到的键或者索引
key 真正用到的索引
key_len 所匹配的索引的长度
ref 使用外键
rows 当前查询所 处理的行数
Extra 额外信息
查询优化的几个原则:
1 能用连接尽可能不使用子查询;
2 尽可能使用会话变量及临时表来代替子查询(临时表,内存表),但临时表的大小不要超过系统限制的大小;
MySQL> explain select name from stu where age> (select avg(age) from stu);

使用会话变量:
mysql> select @AVG:=avg(age) from stu;

mysql> select name from stu where age >@avg;

3 显式使用字段,尽量不使用通配符;
4 尽可能对连接中使用的字段使用索引。
