Answer the question
In order to leave comments, you need to log in
How to make mysql use index for where in?
Actually at request select * from entries where a in (a1, a2, a3, a4)
In explain shows using where; using index, I would like to see only using index.
Accordingly, requests are executed for 10 seconds, despite the fact that there is a unique index on field a.
Answer the question
In order to leave comments, you need to log in
Sometimes MySQL does not use an index, even if one is available. One circumstance under which this occurs is when the optimizer estimates that using the index would require MySQL to access a very large percentage of the rows in the table. (In this case, a table scan is likely to be much faster because it requires fewer seeks.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question