SELECT myfield LIKE 'A%' use index
SELECT myfield STARTING WITH 'A' use index
SELECT myfield STARTING WITH 'A' OR myfield STARTING WITH 'B' use index
SELECT myfield LIKE 'A%' OR myfield LIKE 'B%' does not use index
I thought that for the optimizer, LIKE 'A%' is equivalent to STARTING
WITH 'A', it seems that is not true when there is an OR
|