I am trying to query Big Object records through Database.getQueryLocator method in a Batch class. However, it is throwing an 'Internal Salesforce Error' on the queryLocator line.

I tried executing queryLocator from Developer Console and again got the 'Internal Salesforce Error'.

Seems like QueryLocator and Big Object don't get along, but I wasn't able to get any sort of documentation for this limitation.

  • This could be per design. Per batch apex documentation, any query that returns more than 50 million records gets terminated. Because Big Object is designed to deal with billion of records, that may be a reason it's not supported in batch apex/query locator. Batch Apex doc link -- developer.salesforce.com/docs/atlas.en-us.apexcode.meta/…
    – Jayant Das
    Commented Apr 6, 2018 at 13:21
  • How many records are in your big object? Commented Apr 6, 2018 at 16:12
  • I don't suppose you got an error number instead of just the general failure error, did you?
    – sfdcfox
    Commented Apr 7, 2018 at 3:48
  • @sfdxfox No there was no error number. Just the generic error message
    – srmaind
    Commented Apr 7, 2018 at 14:30
  • @David, currently there is only one test record in my org
    – srmaind
    Commented Apr 7, 2018 at 14:32

1 Answer 1


I have been struggling with the same, here is what I was told:

The QueryLocator approach is not supported for any Virtual Entities that don't return a total size count. This is because BatchApex needs to know the total number of records to create the correct number of jobs.

So you should use Iterator instead (with all its limits).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .