Bulk Collect VS single insert
886961Sep 8 2011 — edited Sep 13 2011Hi 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.