I have a pretty slow operation to apply to a large number of records (1.5M+).

All these records have not be modified for more than six months.

To get these records I use api calls query() then query_more() to apply my logic by batch. The whole process will probably take a few days.

If, during the execution, the record n°120000 is modified, will it be retrieved with query more or will it be filtered out ?

The documentation say a new QueryLocator is generated but I don't understand what that means.

The queryMore() call processes subsequent records in up to 500-record chunks, resets the server-side cursor, and returns a newly generated QueryLocator.

1 Answer 1


I did not have to go through a similar scenario but I think you have your answer in the following part of the documentation.

We recommend the following:

  • When possible, avoid paging by filtering your queries of external objects to return fewer rows than the batch size, which by default is 500 rows. Remember, obtaining each batch requires a queryMore() call, which results in a Web service callout.
  • If the external data frequently changes, avoid using queryMore() calls. If the external data is modified between queryMore() calls, you can get an unexpected QueryResult.

If this is applicable to external object records, it should also be applicable to internal object records as well.

I hope it helps.

You must log in to answer this question.

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