/* if mysql is dumb and using wrong index you can force it to use
the one you want like so:*/
select name from users USE INDEX (index4) where name='hello';
EXPLAIN SELECT
productName, buyPrice
FROM
products
FORCE INDEX (idx_buyprice)
WHERE
buyPrice BETWEEN 10 AND 80
ORDER BY buyPrice;
Code language: SQL (Structured Query Language) (sql)