做者:沈傑mysql
連接:https://www.zhihu.com/question/36996520/answer/93256153算法
來源:知乎sql
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:ide
EXPLAIN SELECT * FROM student WHERE cid=1;
EXPLAIN SELECT * FROM student WHERE cid=1 AND name='小紅';
做者:沈傑連接:https://www.zhihu.com/question/36996520/answer/93256153來源:知乎