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!

forall vs in clause w/table collection performance

Nathan Rooney-OracleOct 8 2015 — edited Oct 8 2015

Hi in general which approach should perform better when passed a collection of primary keys and performing a bulk sql operation, a forall loop or using an 'in' clause with table()?

For example if I had table x_tbl with a primary key x_id and I was passed a collection of x_id's as t_id and I wanted to delete all the rows represented by those primary keys which should perform better:

forall i in 1..t_id.count

     delete x_tbl where x_id = t_id(i);

or

delete x_tbl

where x_id in (select * from table(t_id));

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2015
Added on Oct 8 2015
4 comments
659 views