Recently I observed serious and undocumented differences in the runtime behaviour of Sandbox vs. Production orgs, e.g.:

  • Batches (same code, same data) run faster in the Sandbox
  • Same Batch in Sandbox sometimes takes 1h and sometimes 6h.
  • Batches abort only in Production due to SOQL running to long

This is really problematic as one cannot rely on code to work in a Sandbox to also work in Production.

Salesforce Support seems not to be able or willing to explain that behavior.So I want to ask you for your experiences with that.


One reason is in Production you may have huge data so the SOQL may give read time out error as you might not have indexed your fields .

Second reason is batch process is async in nature and it will be executed only when resources at salesforce servers are free.

  • The Sandbox has nearly the same amout of data as it is a Full-Copy Sandbox. Production has 20% more records and a full recycle bin. – Robert Sösemann Jul 24 '13 at 9:24
  • Our query is very selective and uses Standard and custom indexes. There is a Standard lookup field that takes 5 million out of 20 million records AND a custom-indexed text field which takes out a few hundred out of those 5 million. So I cannot understand why such a query should time out?! – Robert Sösemann Jul 24 '13 at 9:28
  • clueless!!!But i am sure its huge data and thats the best i can answer as apex developer .Need to just ask sfdc support on why this issue – Mohith Shrivastava Jul 24 '13 at 9:39

I'm not sure if it will be the case for you, but in our Sandbox quite often there is considerably less activity. For example, the scheduled jobs may be switched off, the only users are a handful of developers, inbound web services aren't being hit because all that is pointed at Production.

In that case there is a lot less demand for resources in the Sandbox and so the performance may be better.

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.