I have two queries like this:
SELECT ... FROM ... WHERE (status IN (1,2,3) OR status IN (3,4,5)) AND ... AND status IN (2,3)
and this one:
SELECT ... FROM ... WHERE ... AND status IN (2,3)
These queries are executed in almost same time that makes me think that SQL engine optimizes first query and makes somthing like in second example.
Am I right or wrong? Is there any profit to optimize first query manually to the second one, or I can rely on SQL engine?