I read that MySQL has a problem with queries that use the IN () operator - sometimes indexes cannot be used. Is this true if I do not use a subquery?
Which approach is better? Is there a difference in performance?
one
SELECT * FORM `somewhere` WHERE `id` = 3 OR `id` = 5 OR `id` = 15 OR `id` = 56 OR `id` = 34 OR `id` = 47
2
SELECT * FORM `somewhere` WHERE `id` IN (3,5,15,56,34,47)
mysql query-optimization
Silver light
source share