Not exists inside exists is having very low performence [message #562583] |
Thu, 02 August 2012 07:24 |
|
narsimha6
Messages: 1 Registered: August 2012 Location: Hyderabad
|
Junior Member |
|
|
Hi friends,
I am using a SQL like below.
SELECT columns FROM 4 TABLES with left outer , inner and left outer joins
AND ( EXISTS( this query is performing fast...)
OR ( EXISTS ( SELECT 1 FROM TABLEA WHERE condition
AND NOT EXISTS(SELECT 1 FROM TABLE B , TABLE C WHERE B.XXX = C.XXX AND extremeouter table reference.XXXX = c.XXXX )
)
)
)
In this case it is performing very slow and CPU cost is 25752.
Even I tried the same with outer join like below.
SELECT columns FROM 4 TABLES with left outer , inner and left outer joins
AND ( EXISTS( this query is performing fast...)
OR ( EXISTS ( SELECT 1 FROM TABLE A, TABLE B , TABLE C WHERE B.XXX(+) = C.XXX
AND other conditions
AND ROWID is NULL
AND extremeouter table reference.XXXX = c.XXXX
)
)
)
This is also performing very slow and CPU cost is 25752.
Can anyone please help me on this.
Thanks in advance
Bhaskar
|
|
|
|
|