Hi Raju, Here's a link that might help: http://www.infallibletechie.com/2013/05/difference-between-databasequery-and.html
Also, 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
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.
Hi Raju,
Here's a link that might help:
http://www.infallibletechie.com/2013/05/difference-between-databasequery-and.html
Also,
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
Ref: http://salesforce.stackexchange.com/questions/64805/governor-limits-database-getquerylocator
Thanks!
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.