oracle sql query efficiency

* Start the loop.
* 1 The priority of ORACLE query conditions is from right to left, so data with a high degree of filtering should be placed in the back;
* 2. Use as little as possible*.
* 3. in and exists:
1) select * from T1 where exists(select 1 from T2 where T1.a=T2.a) ;
2) select * from T1 where T1.a in (select T2.a from T2) ;
When T1 data volume is small and T2 data volume is very large, when T1<<T2, the query efficiency of 1) is high.
The data volume of T1 is very large and the data volume of T2 is small. When T1>>T2, the query efficiency of 2) is high.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326444876&siteId=291194637