I would like ask if there is any performance advantage of 1 over the other.
Here is an example:
// suppose I want to retrieve 10000 different records
select *
from table_a
where from in (1,2,3,4,5,6 .... 10000)
// alternatively
select *
from table_a
where from=1 or from=2 or from=3 ... from=10000
compared to
select * from table_a where from=1
select * from table_a where from=2
select * from table_a where from=3
.
.
select * from table_a where from=10000
What are the scenarios that one will outperform the other?
The WHERE
clause is simplified here, it may have nested AND and OR clauses.