If I write this query,
EXPLAIN SELECT * FROM `smth` WHERE d_id = 9
it checks one row instantly. But when I use IN
, for example
EXPLAIN SELECT * FROM `smth` WHERE d_id IN (9, 3)
it checks all rows. What should I do instead of IN if index doesn't help there?