复合索引的优化
table1 里面有5个字段
col1,col2,col3,col4,col5
如果我的查询条件有
where col1='A' and col5='test'
where col2='A' and col5='test'
where col3='A' and col5='test'
where col4='A' and col5='test'
应该怎么样建好比较有效率的组合索引呀?
我现在是分别建4个
col1,col5
col2,col5
col3,col5
col4,col5
但这样col5 不是会出现多个索引里面了,不知道会不会影响效率
大家有什么更好的方法吗?