Integration Process taking much longer than normal. We have an integration process which deletes a few hundred thousand records in salesforce per day.

Since last few days the process has got too much slow. The only change we made is a new rollup summary field called Revenue_Daily_total_Direct_USD__c was added to the Account object, which is the master in a master-detail relationship with the object we are trying to delete.

Would we be able to get recommendations on how to best address the issue? Is there some way we can modify the roll up summary field to prevent or reduce the impact on the performance of our deletion process? Or is removing the field the only choice? Please advise.

  • well, by definition, if a detail that participates in a RSF is deleted, the RSF needs to be recalculated. – cropredy Sep 4 '14 at 18:13

The system has to recalculate totals each transaction, so by using standard rollups, you'll necessarily suffer this slowdown, especially on parent records that have many children records. Using standard rollups, you can reduce this effect by grouping deletes by the parent record so that the effect is minimized.

If you were willing to accept a delay in totals, you could implement as Apex Code that runs every few minutes (say, every 10 minutes), and performs the updates asynchronously, or even once a day, etc, depending on how real-time you want/need this data to be refreshed. You could even simply implement the rollup as a @future method, which would execute "near immediately" in most cases, but this may cause unnecessary record locks if many records from the same parent are deleted in close proximity to each other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.