Given this query;
select my_field1
from my_table
where my_field2 in ('five', 'six')
If i have an index on my_field2 it does not get used. Is there a way to optimize this to make use of my index?
Given this query;
select my_field1
from my_table
where my_field2 in ('five', 'six')
If i have an index on my_field2 it does not get used. Is there a way to optimize this to make use of my index?
The Optimizer chooses to ignore the index when the 'cardinality' is low. This is because simply scanning the entire table is likely to be faster than bouncing back and forth between the INDEX's
BTree and the data BTree.