CHANGING BATCH SIZE IN SOQL QUERIES:
The number of rows returned in the query result object (batch size) returned in a query() or queryMore() call is set to 500. WSC clients can set the batch size by calling setQueryOptions() on the connection object. C# 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.
The number of rows returned in the query result object (batch size) returned in a query() or queryMore() call is set to 500. WSC clients can set the batch size by calling setQueryOptions() on the connection object. C# 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.
Example:
Sample Java (WSC) code demonstrates setting the batch size to two hundred and fifty (250) records.
public void queryOptionsSample() { connection.setQueryOptions(250); }
sample C# (.NET) code demonstrates setting the batch size to two hundred and fifty (250) records.
private void queryOptionsSample() { binding.QueryOptionsValue = new QueryOptions(); binding.QueryOptionsValue.batchSize = 250; binding.QueryOptionsValue.batchSizeSpecified = true; }