0

I have a Batch Apex operation that is part of a managed package that is failing in the start() method or soon after since the start() log is the last one displayed. I run a SOQL query that gets all fields (essentially SELECT * FROM Account WHERE Id != null) for all Account objects as well as two subquery aggregations on Contacts and Opportunities for the Account (but with LIMIT of 10 each).

When building the query, I get all fields on an Account using something like this..(it works) Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap

It runs with no problem (ie within 1800 ms on 1000 records) in my organization's production org. But when I move to a customer's org, it slows considerably (ie 90,000 to 120,000 ms on 5000 records) and causes a CPU timeout error. What could cause such a difference in performance from my org to a customer's org? Any suggestions? I could cut some of the fields out since I do not need all fields but every customer's field set is different so I need the dynamic build on the fields used in the query.

bswartz
  • 27
  • 1

0 Answers0