Quantcast
Viewing all articles
Browse latest Browse all 1987

How to Tune SQL with Exists Operator in Certain Environment for Oracle?

Here is an example SQL that retrieves data from EMPLOYEE table with “emp_id < 710000” and employee’s department code exists in DEPARTMENT table.

select *
from employee
where emp_id < 710000
and exists (select 'x'
from department
where dpt_id = emp_dept)​

Here the following are the query plan of this SQL, it takes 34.22 seconds to finish. The query plan is very complicated, although the SQL is quite...

How to Tune SQL with Exists Operator in Certain Environment for Oracle?

Viewing all articles
Browse latest Browse all 1987

Trending Articles