组合索引问题请教

study_win 2014-05-14 06:35:24
大家好

某一表中有如下索引
UNIQUE indexA(`colE`,`colA`,`colD`,`colB`,`colC`)
indexB(`colA`,`colB`,`colC`,`colD`)

执行查询
explain select colD from test where colA='' and colB='' and colC='' and colD>=xxx and colD<=xxx

为何这个查询命中了indexA的索引?
...全文
53 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
rucypli 2014-05-15
  • 打赏
  • 举报
回复
测试数据太少的原因把
ACMAIN_CHM 2014-05-14
  • 打赏
  • 举报
回复
贴出 explain select .. show index from ... 以供分析。

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧