您的位置:首页 > 职场人生

一个索引的面试题

2017-02-23 00:00 176 查看
假设某个表有一个联合索引(c1,c2,c3,c4)一下——只能使用该联合索引的c1,c2,c3部分

A where c1=x and c2=x and c4>x and c3=x

B where c1=x and c2=x and c4=x order by c3

C where c1=x and c4= x group by c3,c2

D where c1=x and c5=x order by c2,c3

E where c1=x and c2=x and c5=? order byc2,c3

个人认为选 a由于使用的> 导致右边c4 c3 不能使用索引

B的话可以用到c 1 2 3 4 的索引

C只能用到c 1 2

D用到 c1 2 3

E不确定

大家各抒己见,欢迎拍砖
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: