[SalesForce] Governor limits when inserting/updating records using Dataloader

I am upserting some data using dataloader. The csv file has around 50,000 records in it which I am upserting. I have a trigger on the object where I am upserting these records.

My question -> I know that the 50,000 records will be broken down into chunks of records ( from 200 to 2000) based on what number specified in the dataloader. I would like to know if each batch of records has 200 records , so 50,000/200 = 250 batches each has 200 records. How does the trigger behave in this case. Will the governor limits be calculated until all the 250 batches are completed( 250 batch = 1 transaction) or there will be separate governor limits for each batch of records(250 batch = 250 transactions)?

Best Answer

The governor limit will be refreshed for each transaction .

Your Trigger needs to ensure that for 200 record set you are not doing below in a single transaction

10K DML rows ,

Fetching more than 50K records ,

Doing more than 150 DML (This is not possible unless you have DML inside loop or there is a dependent object that triggered and you have chain of triggering events ) ,

Doing more than 100 SOQL statements (Again this can happen if you have query inside FOR loop)

Transaction here may include any other trigger or workflow that triggered due to DML of the triggering object

Related Topic