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-6afe82608773e830286607/] The CPU profile indicates that 99% of CPU time was spent in [crayon-6afe826087745076157651-i/] on MySQL 8.4. [crayon-6afe826087748521900331/] How MySQL evaluates OR c
[...]
