day16

EXPLAIN  用于分析SQL执行计划,核心字段解读:
type:连接类型,反映查询效率(从优到差): system  >  const  >  eq_ref  >  ref  >  range  >  index  >  ALL (全表扫描,需优化)。
key:实际使用的索引名(为 NULL 表示未用索引)。
rows:预估扫描行数,值越小效率越高。
Extra:额外信息,关键如  Using index (覆盖索引,优)、 Using where (需过滤)、 Using filesort (文件排序,差)、 Using temporary (临时表,差)。

posted @ 2025-08-10 13:10  喜欢写轻小说的日央  阅读(6)  评论(0)    收藏  举报