在以下两种情况下:
create table `Table` (
`id` int(10),
`column1` int(10),
`column2` int(10),
KEY (`column2`)
);
和
create table `Table` (
`id` int(10),
`column1` int(10),
`column2` int(10),
KEY (`column1`, `column2`)
);
现在考虑查询select * from Table where column2=xxx;
第二种情况是否有可能比第一种情况更快,例如在行恰好在 column1 上密集聚集的情况下?
或者我们可以 100% 肯定地说,第一种情况总是至少和第二种情况一样快?
我尝试搜索复合/复合键速度,但与单键相比,找不到 100% 确定的答案。