Why MySQL OR is slower than IN (from Percona Database — MySQL)
pQueries with OR conditions are commonly used to implement business logic. However, it might be slower than we expected. Although the query below scans only 1 million rows, it runs for 6,7254 seconds. [crayon-6afe43109568d164759682/] The CPU profile indicates that 99% of CPU time was spent in [crayon-6afe431095697009922433-i/] on MySQL 8.4. [crayon-6afe43109569a648843276/] How MySQL evaluates OR c
[...]
