We have a Java API which uses Bulk API to extract records from an Object. The "select query" has a where clause, which should extract a subset of records, to honour the where clause, but we see that huge numer of batches are created on the Salesforce Server side, and many a times, the BULK API limits are hit
For example :
Number of records in the Object Account : 20000 We enable the connection and set the Pk Chunking header as , with chunk size as 2000
Select Query :
SELECT Id, Name FROM Account WHERE CreatedDate >= 2018-07-20T05:00:00.000Z"
As per the query to match the condition, the query should return only 10 records (at most 1 batch), but we see that there are 10 batches created on the Salesforce Server.
Why is there 10 batches that are created, when the number of records to be extracted is only 10 which can fit in 1 batch.
Is there any setting that can be applied, or code tuning that can be done so that only 1 batch is created on the Salesforce Server