Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Tune the query with join and not exists

511057Nov 22 2007 — edited Nov 28 2007
This 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2007
Added on Nov 22 2007
16 comments
1,625 views