blog icon indicating copy to clipboard operation
blog copied to clipboard

MySQL 中 EXPLAIN 命令详解 - overtrue

Open overtrue opened this issue 7 years ago • 7 comments

https://overtrue.me/articles/2014/10/mysql-explain.html

EXPLAIN 显示了 MySQL 如何使用索引来处理 SELECT 语句以及连接表。可以帮助选择更好的索引和写出更优化的查询语句。 使用方法,在 select 语句前加上EXPLAIN就可以了: 如: EXPLAIN SELECT surname,first_name FORM a,b WHERE a.id=b.id EXPLAIN列的解释: 列 描述 table 显示这一行的数据是关于哪张表的。 type 这是重要的列,显示连接使用了何种类型。从最好到最差的连接类型为 const、eq_reg、ref、range、index和ALL。 possible...

overtrue avatar May 04 '18 02:05 overtrue

翻译得什么呀?贴个原文链接多好

chaitd avatar May 11 '18 03:05 chaitd

@chaitd 翻译得什么呀?贴个原文链接多好

sorry, 从很早的笔记里找到的,我也不晓得从哪里来的,翻译的不好,还请大佬多多指教,谢谢!

overtrue avatar May 11 '18 03:05 overtrue

https://dev.mysql.com/doc/refman/5.5/en/explain-output.html 英文参考

chaitd avatar May 16 '18 10:05 chaitd

@chaitd https://dev.mysql.com/doc/refman/5.5/en/explain-output.html 英文参考

Nice ~

medz avatar May 24 '18 06:05 medz

超哥,列 type 中的连接类型是eq_ref还是eq_reg?

StopTheword avatar Sep 08 '18 08:09 StopTheword

@StopTheword 超哥,列 type 中的连接类型是eq_ref还是eq_reg?

应该是 eq_ref

overtrue avatar Sep 08 '18 09:09 overtrue

@chaitd https://dev.mysql.com/doc/refman/5.5/en/explain-output.html 英文参考

支持

sysummery avatar Oct 27 '19 09:10 sysummery