OR

suggest change

In general OR kills optimization.

WHERE a = 12 OR b = 78

cannot use INDEX(a,b), and may or may not use INDEX(a), INDEX(b) via “index merge”. Index merge is better than nothing, but only barely.

WHERE x = 3 OR x = 5

is turned into

WHERE x IN (3, 5)

which may use an index with x in it.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents