日期:2014-05-16  浏览次数:20814 次

请教各路高手:MySQL的Explain结果中Extra为空值代表什么意思?
explain
select a.id,a.cid,a.title,a.`date`,a.description,b.ctitle,b.cname from tb_2_content as a left join tb_2_category as b on (a.cid=b.cid) order by id desc limit 6

a是文章表,id为PK,cid为普通索引(分类ID)
b是分类表,cid为PK
这是读取最新发布的6篇文章,并把对应的分类名称读出来。

Explain的结果是:

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a index (NULL) PRIMARY 4 (NULL) 9653  
1 SIMPLE b eq_ref PRIMARY PRIMARY 4 minisite.a.cid 1


请教下各位,Extra为空值是代表什么意思?是最好还是最坏?谢谢了

------解决方案--------------------
好。算不是上是最好。 using index 可能算是最好。
------解决方案--------------------
extra是扩展的,算是比较好的了。