Skip to Main Content

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.

Question and Answer

Connor McDonald

Thanks for the question.

Asked: July 08, 2021 - 1:19 pm UTC

Last updated: July 09, 2021 - 7:30 am UTC

Version: 18.4.0.376

Viewed 1000+ times

You Asked

HI Tom,

Can you please tell me what should be minimum row/processing count to use bulk collect/for-all .

My procedure would get around few 100s of records for record, should I go with bulk/for all or for loop.


Thanks
Raja.R

and Connor said...

My rule of thumb is

1 row => no bulk
1-20rows => maybe
>20 rows => use bulk

because *typically* (not always) the moment you have more than 1 row, there is often no real upper limit on the number of rows you might encounter.

The "maybe" covers the difference between a fixed list of rows and a list that may grow over time.

Also...a lot depends on *where* you are running this from. If I have a 10second latency per insert, then I will be bulk binding the moment I get 2 rows :-)

But don't get too wrapped up in rules/numbers - go with what works best for your situation and your environment

We're not taking comments currently, so please try again later if you want to add a comment.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library