如何看SQL使用联合索引中的哪几个字段?

问题:在mysql中用a,b,c三个字段建立一个复合索引a_b_c,请问以下哪个查询效率最差?
A、select * from test where a=10 and b>50
B、select * from test where a=10 and b>10 order by c
C、select * from test where a=10 and b=10 order by a
D、select * from test where a=10 and b = 10 order by c

如何查看以上语句命中了联合索引中的哪几个字段?

阅读 2.2k
2 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题