|
SQL> alter session set events='10053 trace name context forever, level 1';
Session altered.
SQL> select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (d.deptno = e.deptno(+) and 'D' = 'D' and d.deptno in(40)); 2 3 4 5
DEPTNO EMPNO DEPTNO
---------- ---------- ----------
20 7369 20
20 7566 20
10 7782 10
20 7788 20
10 7839 10
20 7876 20
20 7902 20
10 7934 10
40
10053 Trace:
--After transformation:
SQL:******* UNPARSED QUERY IS *******
SELECT "D"."DEPTNO" "DEPTNO","E"."EMPNO" "EMPNO","E"."DEPTNO" "DEPTNO" FROM "SCOTT"."DEPT" "D","SCOTT"."EMP" "E"
WHERE 'D'='D' AND "D"."DEPTNO"="E"."DEPTNO"(+)
AND (("D"."DEPTNO"=10 OR "D"."DEPTNO"=20) OR "D"."DEPTNO"=40)
Current SQL statement for this session:
select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (
d.deptno = e.deptno(+) <<======This condition was merged.
and 'D' = 'D' and d.deptno in(40))
|
|