function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saravanan Gengan 9Saravanan Gengan 9 

data loader batch size

When should i use data loader batch size 1? 
Saravanan Gengan 9Saravanan Gengan 9
Or what is the impact if i use batch size is one? 
Sumit Kumar Singh 9Sumit Kumar Singh 9
One scenario can be - When your trigger is not bulkified i.e can't handle list of records at once. By reducing the batch size to 1 will process all the records. 
Sohan Raj GuptaSohan Raj Gupta
Hi Saravanan,

The maximum value of batch size is 2,000. Note the implication for a large parameter value: if an error occurs, all records in the batch are rolled back. In contrast, if the value is set to 1, each record is processed individually (not in batch) and errors are specific to a given record. We recommend setting the value to 1 when you need to diagnose problems with writing to a database.


Hope this will help you.

Please let me know if it helped or you need any more assistance. Please mark this is as the solution if it solved your purpose.

Thanks,
Sohan Raj Gupta

 
Saravanan Gengan 9Saravanan Gengan 9
Hi Sohan, I dont think all the records in the batch are rolled back in the data loader. After you load data you will get 2 files, One is success and other is failure so failed records are will be moved to that files. Success records will be saved to DB.
Saravanan Gengan 9Saravanan Gengan 9
Hi Sumit Kumar Singh, I believe it not good advice to write trigger for single record. It will be always bulkified. In that case what is impact of using batch size 1. Even batch size 1 or 2000 you can see the error for each records in the error file. 
Sumit Kumar Singh 9Sumit Kumar Singh 9

Hi Saravanan,

I didn't advise you to write a trigger for single record.You didn't get my answer.See the link and go throgh the comments/answers - 
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000kFUmIAM