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
TechTrackerTechTracker 

Number of records returned by the SOQL query in one batch?

Hi,

 

I am checking SOQL execution and how batchSize works. I refereed link below...

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_changing_batch_size.htm#topic-title

 

it tells that the default batchSize is 500, and max is 2000. Surprisingly my API call is returning 2000 records even though I didn't mention the batchSize. 

 

Could anyone tell me why my API call is returning 2000 records in one batch by default?

 

Default batch size returned by the API is 500or 2000 records?

 

TuanLeTuanLe

It was stated right in the page you quoted. "By default, the number of rows returned in the query result object (batch size) returned in a query() or queryMore() call is set to 500. Client applications can change this setting by specifying the batch size in the call QueryOptions portion of the SOAP header before invoking the query() call. The maximum batch size is 2,000 records. However this setting is only a suggestion. There is no guarantee that the requested batch size will be the actual batch size. This is done to maximize performance." So, probably, the system just internally decided to return such number of records at that time.

 

 :-)

TL 

TechTrackerTechTracker

You mean, Systen will internally decide appropriate batchSize that is suitable when user does not specify externally in the call. Am i right?

 

 

 - TT