Tune the query with join and not exists
511057Nov 22 2007 — edited Nov 28 2007This is on 10g R2.
I have a query similar to :
Select A.*, C.*
From A inner join B on A.id = B.id
Left join C on A.kid = C.kid
Where not exists
(select * from D where A.fid = D.fid and A.stat = 2);
I want avoiding to use the NOT EXISTS in the last part of the query
I tried the autotrace explain of above and compared with others format and found no better execution plan than that. The explain plan indicated that there were long "table access full" operation on B, due to its little huge records, and a long operation of the "NESTED LOOPS OUTER". I had tried to replace the NOT EXISTS part with another LEFT JOIN in the FROM, but it went worse. So Anyone can suggest a better way? or it is the most efficient query I can get?