I’m developing an application which processes many data in Oracle database.
In some case, I have to get many object based on a given list of conditions, and I use SELECT ...FROM.. WHERE... IN..., but the IN expression just accepts a list whose size is maximum 1,000 items.
So I use OR expression instead, but as I observe — perhaps this query (using OR) is slower than IN (with the same list of condition). Is it right? And if so, how to improve the speed of query?
INis preferable toOR—ORis a notoriously bad performer, and can cause other issues that would require using parenthesis in complex queries.Better option than either
INorOR, is to join to a table containing the values you want (or don’t want). This table for comparison can be derived, temporary, or already existing in your schema.