Categories
list mysql performance postgresql

Speed of IN keyword in MySQL/PostgreSQL

I’ve heard lots of people saying that the IN keyword in most relational databases is slow. How true is this? An example query would be this, off the top of my head:

SELECT * FROM someTable WHERE someColumn IN (value1, value2, value3)

I’ve heard that is much slower than doing this:

SELECT * FROM someTable WHERE
someColumn = value1 OR
someColumn = value2 OR
someColumn = value3

Is this true? Or is the speed difference negligible? If it matters, I’m using PostgreSQL, but I’d also like to know how MySQL fares (and if it’s any different). Thanks in advance.