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!

How can I speed up MINUS operation or make it more efficiant ?

rahulrasAug 3 2011 — edited Aug 3 2011
Hi All,

I am on 11.2 on Linux.

I will be running a query which does a MINUS operation between 2 tables. Both tables are identical in structure, they have about 50 columns and one column (out of those 50 columns) is a primary key. Both tables will have 5 to 10K records (but can get bigger).

The intended MINUS operation is kind of finding difference between tables e.g.
select col1, col2, col3,......., col50 from table1
minus
select col1, col2, col3,......., col50 from table2 ;

I am not entirely sure, how Oracle internally processes MINUS. We can easily guess, there will be a full table scan on both tables.

Is there any special trick to make this MINUS more efficiant (resource wise) and/or fast ??
Please share your experiences.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2011
Added on Aug 3 2011
6 comments
4,101 views