执行计划获取
mysql> desc select * from oldboy.t100w where k2='EF12'\G
id : 1
select_type : SIMPLE
table : t100w
partitions : NULL
type : ref
possible_keys : idx_k2
key : idx_k2
key_len : 17
ref : const
rows : 293
filtered : 100.00
Extra : NULL
1 row in set, 1 warning (0.00 sec)
table: t100w
type: ref 索引的应用级别
possible_keys: idx_k2 可能会使用到的索引
key: idx_k2 实际上使用的索引
key_len: 17 联合索引覆盖长度
rows: 293 查询的行数(越少越好)
Extra: NULL 额外的信息
网友评论