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!

Bulk Collect VS single insert

886961Sep 8 2011 — edited Sep 13 2011
Hi guys, just a quick question (hopefully) on this subject.

I have a table (T1) containing 4,000,000 rows of ids (not all unique). I was going to create a cursor pulling back all distinct id's from this table, look for the id in T2, and then insert that data from T2 into T3 (the archive table for T2).

I was going to do this through bulk collect/forall loop with limits set.

Would this be quicker than a simple DML like below:

INSERT into T3
select * from T2 where T2.id=(select distinct T1.id from T1);

The id column on T1 and T2 is indexed and is the primary key, and I expect there to be around 130,000 inserts to T3.
This post has been answered by 32685 on Sep 13 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2011
Added on Sep 8 2011
11 comments
1,882 views