Oracle Performance IN or OR

Which statement in oracle gives the best IN or OR performance

Example:

select * from table where y in (1,2,3)

or

select * from table where y = 1 or y = 2 or y = 3
+3
source share
4 answers

You want the explanation plan to be sure, but I would expect the performance to be identical.

+9
source

Both operators are equivalent, the optimizer will generate the same access path. Therefore, you should choose the one that is the most readable (I would say first).

+8
source

OR, . , . , AND , .

:

select * from table where y = 1 or y = 2 or y = 3

:

select * from table where ( y = 1 or y = 2 or y = 3 ) AND x = 'value'

. IN OR.

+4

, , , 100% , .

, 100%.

. , , . Sybase, , Oracle ( , "" ).

+1

Source: https://habr.com/ru/post/1717152/


All Articles