Below is my query which throws the exception and is used in the trigger handler
SELECT Id, RecordTypeId, Status, customObj1__c FROM Case
WHERE customObj1__c IN : customObj1_Ids AND RecordTypeId IN : caseRecordTypes
customObj1_Ids
is List of custom object Ids andcaseRecordTypes
is set of case record types, predefined values
As per the help document if the fields in WHERE clause are standard indexes the query is selective. And when I look at this query, what we have used is Id fields, both of which are indexed.
What might have caused the issue then..? Making the method to Future or Moving the logic to a batch would help to resolve this..?