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

Bulk API query batch size limit.

As per I know when I am fetching the records from salesforce using bulk API , each batch contains 10,000 records.
Currently I have more than 5,00,000 records in my salesforce enterprise org, but it is creating only one batch  and using that batch it is retrieving all the records . What may be the reason? .

I have done the following steps :
1 : Created a job using sessionId
2 : added a batch to the job and got the following output

output :

<?xml version="1.0" encoding="UTF-8"?><batchInfo
<id>75190000001NuAWAA0</id>     -----> Only one batch is created for more than 5,00,000 records

3 : Retrieved the batch result using the query : Select Id from Case , It is returning all the 5,00,000 Ids.

Please help me to get to know the things clearly.
Also let me know if is there any way to set the batch size manually.

Hi Anupama, 

The reason may be the Query is hitting Execution server only once, which should be iterative in hitting server with 10'000 multiple times. 

The code should be iterative in such a way that every time it hits the Server it should go with 10000 records at a time until the entire records are retrived / filtered etc. 

See the code Samples in the link below,