+ Start a Discussion
inbox outbox 7inbox outbox 7 

Batch apex limits. Please provide your input.

1. Batch class can work on upto 50k records using Iterator. Is that right?
2. If you use an iterable, the governor limit for the total number of records retrieved by SOQL queries is still enforced. For more information on using iterables for batch jobs
3.  If the start method of the batch class returns an iterable, the scope parameter value has no upper limit. However, if you use a high number, you can run into other limits. The optimal scope size is a factor of 2000, for example, 100, 200, 400 and so on.

I am bit confused with these limits. Please explain. 
 
PriyaPriya (Salesforce Developers) 
Hey

Kindly refer this guide :- 

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm

Thanks!
inbox outbox 7inbox outbox 7
Priya, 

I appreciate the link. It does give me the governor limits but doesn't answer my question. 


1. Does point 1 and 2 refer to the same limits of soql returning 50,000 records. 2. "the governor limit for the total number of records retrieved by SOQL queries is still enforced."  Does it mean we can query up to 50,000 records while using iterator?
3. So the scope while using iterator can be more than 2000 as in 2001 will work? is that right?