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!

Comparing huge table data efficiently (About 30 Million records)

DIVIJul 23 2013 — edited Aug 13 2013

In my application requirement is to find the difference data between 2 tables (Both tables are with same structure)  and store that difference data to another table

Let say source table name is T_S, target table is T_T and difference table is T_D.

To do this there are 3 queries written, they are

1) insert into T_D (select * from T_S),'INSERTS'   where data not in T_T;  

 

              This query to find inserts

2) insert into T_D (select * from T_T), 'DELETES' where data not in T_S;

             This query is to find deletes


3)  insert into T_D (select * from T_S),'UPDATE' where (data of T_S)  != (data of T_T);


          This query is to find updates


These queries are taking more than an hour to execute, Is there any other way to achieve this problem OR any other way of writing these queries efficiently ? ?

Thanks,

divi

This post has been answered by Karthick2003 on Jul 23 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2013
Added on Jul 23 2013
17 comments
3,242 views