标签:为我 好的 har actual mysql索引 int char not 答案
作者:沈杰
链接:https://www.zhihu.com/question/36996520/answer/93256153
来源:知乎
CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `cid` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `name_cid_INX` (`name`,`cid`), KEY `name_INX` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8
执行1:
EXPLAIN SELECT * FROM student WHERE name=‘小红‘;
执行2:
EXPLAIN SELECT * FROM student WHERE cid=1;
EXPLAIN SELECT * FROM student WHERE cid=1 AND name=‘小红‘;
作者:沈杰
链接:https://www.zhihu.com/question/36996520/answer/93256153
来源:知乎
标签:为我 好的 har actual mysql索引 int char not 答案
原文地址:http://www.cnblogs.com/Yiran583/p/6697996.html