Because MySQL cannot optimize it.
Here is an example:
explain select * from keywordmaster where id in (1, 567899);
plan (sorry for the external link. Not displayed here)
here is another request:
explain select * from table where id = 1 union select * from keywordmaster where id = 567899
plan
As you can see in the second query, we get ref as const , and type - const instead of a range. MySQL cannot optimize range scans.
source share