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

"Too many script statements" limitation for high-volume Apex executions

We have developed some Apex code that is executed upon insert/update of an object (foo__c).  In order to appropriately fullfil the client's requirements, the code must be able to handle over 500,000 records in a "single insert/update" (the records will be inserted/updated via an automated process using the web services API).  The Apex class method contains iterators, which compounds the number of script statements executed, but they are necessary.


We have tested the code with sample data and have found that it complies with most of the governor limitations with the exception of "Too many script statements".  First off, does anyone know how the script statment count is generated?  What is the scope of the count (i.e., per API insert/update command, per trigger execution, per class method execution, etc.?  What exactly defines a statement (i.e. is 1 statement == 1 line of code, 1 statement == 1 logical process like an IF statement, etc.)?


I have heard that there is a certification process that will alleviate some of the governor limitations, specifically for apps posted on AppExchange.  Is it possible to enable this on a private package, such as ours for a single client?


Thanks in advance!