建立表:
CREATE TABLE `ygzt_test` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`a` int(11) NOT NULL,
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
`d` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `a` (`a`,`b`,`c`,`d`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='测试';
一、实验一,无order by
首先加联合索引a,b,c,d
explain select * from ygzt_test where a=1 and b=2 and c=3 and d=4