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
penchala rajupenchala raju 

What all the governing limits of Database.getQueryLocator


Hi Raju,
Here's a link that might help:

Use the Database.QueryLocator object when you are using a simple query (SELECT) to generate the scope of objects used in the batch job. If you use a querylocator object, the governor limit for the total number of records retrieved by SOQL queries is bypassed. For example, a batch Apex job for the Account object can return a QueryLocator for all account records (up to 50 million records) in an organization. Another example is a sharing recalculation for the Contact object that returns a QueryLocator for all account records in an organization



rajesh gandirajesh gandi
database.getQueryLocator returns a Query Locator that runs your selected SOQL query returning list that can be iterated over in bathc apex or used for displaying large sets in VF (allowing things such as pagination). 
Total number of records retrieved by Database.getQueryLocator ---> 10000 ?
What does this mean? The limits are reset for every execute(), not for every start()execution, so the records are retrieved in a single start() call and we able to retrieve much more than 10k records by a getQueryLocator.