... WHERE index_part1=1AND index_part2=2AND other_column=3/* index = 1 OR index = 2 */... WHEREindex=1OR A=10ANDindex=2/* optimized like "index_part1='hello'" */... WHERE index_part1='hello'AND index_part3=5/* Can use index on index1 but not on index2 or index3 */... WHERE index1=1AND index2=2OR index1=3AND index3=3;
/* index_part1 is not used */
... WHERE index_part2=1 AND index_part3=2
/* Index is not used in both parts of the WHERE clause */
... WHERE index=1 OR A=10
/* No index spans all rows */
... WHERE index_part1=1 OR index_part2=10