Hacker News new | ask | show | jobs
by sgarland 268 days ago
As an aside, MySQL will optimize WHERE IN better than OR, assuming that the predicates are all constants, and not JSON. Specifically, it sorts the IN array and uses binary search.

That said, I’m not sure if it would have any impact on this specific query; I’d need to test.

1 comments

The article is specifically discussing cases where you have predicates on different columns OR'ed together, like col_a = 'foo' OR col_b = 'foo'.
Oof, misread that.