There is a object(assume A) which will store event logs for a custom object(assume B). A batch job, runs weekly on object A to delete the records based on some conditions. It throws an exception like below:
System.LimitException: Too many query locator rows: 50000001
What is the recommended solution for this exception. There is already some WHERE clause in the SOQL query, but the matching record count is high.
Can we control this by keeping LIMIT 50000000 in dynamic query? But how to process all records in batch apex without skipping the records?