System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
From documentation:
Even if a field is indexed a filter might still not be selective when:
- The filter value includes null (for instance binding with a list that contains null)
- Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)
Identified the object is having more than 200,000 records and below is the method which is been affected with index field.
jj_sss_Question_And_Answer__c q = [select
id,
jj_sss_Community__c,
jj_sss_Community__r.jj_sss_Hero1__c,
jj_sss_Community__r.jj_sss_Hero2__c,
jj_sss_Community__r.jj_sss_Hero3__c,
jj_sss_Status__c,
jj_sss_Title__c,
jj_sss_Body__c,
jj_sss_Question_Posted_By__c,
jj_sss_Question_Creation_Date__c,
jj_sss_Feed_Item_Id__c,
jj_sss_First_answer_received_date__c
from jj_sss_Question_And_Answer__c
where jj_sss_Feed_Item_Id__c = :Comment.FeedItemId and jj_sss_Feed_Comment_Id__c = null];
Can anyone help resolve this issue?