开发者

What is the best way to insert 2 million records to Account object in salesforce

开发者 https://www.devze.com 2023-02-26 03:27 出处:网络
We have used Apex Data Loader to insert/delete records, but it is taking more time when the huge data.

We have used Apex Data Loader to insert/delete records, but it is taking more time when the huge data.

Could you please let us any alternati开发者_运维技巧ve ways to achieve this.


mmix's answer is correct, I'd use the latest data loader, turn on bulk api, and let it loose on your data. You could also use a partner, like Informatica, they have a lot of experience with large loads.

Behind the covers, the bulk api streams your upload to (redundant, backed up) disks, and then queue an uploading job to load into the db, with parallel threads (if you have more than one batch). This can be quite fast, millions of records an hour, but speed can vary for many reasons. There are no guarantees, this is an asynchronous api.

If you have many apex triggers, or workflow, or your load involves sharing updates (ownership changes, etc), this can slow down the load by many orders of magnitude.

If you're truly stuck with slow loads, you can also file a support case and have one of our perf guys trace your load as it goes through, see where the time is being spent.

hope that helps.


If you can use the force.com platform, there is a Bulk API which you could use. See also this Dreamforce 09 notes.


If you want to do it yourself, either use BulkAPI or Administrative setup data import (Setup|Administration Setup|Data Import|Import Business Accounts). Keep in mind that BulkAPI has a limit of 10,000 rows per batch and Administrative import has a limit of 50,000 rows per upload, so you will have to slice up your data.

Alternatively, newer versions of Data Loader external application support new BulkAPI and can slice things for you, you can download the Data Loader from the Setup menu, under Administration Setup|Data Management. Run an import from there and let the app slice the data into batches.

If the import is too slow you can try and temporarily suspend triggers, non-essential workflows and account validations. Other than that not much you can do, keep in mind that salesforce database is not a direct database, its an abstraction layer which has to chew on every piece of data before it persists on the actual database, that always inflicts performance penalties.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号