Unofficial Hacker News companion — get notified on comment replies, and more.

Why MySQL OR is slower than IN (opens external site)

22 points by millspore 3 days ago | www.percona.com | 14 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. This is true, but the optimizer considers them so. They're more expensive than e.g. adding two ints.

    Of course, if they're rewritten to a semijoin or similar, they won't be subqueries anymore or indeed not conditions at all, so sorting them is not applicable.