You need to sign in to do that
Don't have an account?

ApexTrigger: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter
I am getting this error in the ApexTrigger in the production environment , And i am also pasting the query where i am getting this error
Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
,AccountId
from Contact
where AccountId in :acctIds and Name != null and Contact_Type__c includes ('Technical Contact')]);
ApexTrigger: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null) 2. 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)
I have searched so many blogs in google , what ever they suggested in that blog are there in this query , eventhough i dont know why i am getting this error.
If any one have any idea on this , please Kindly help me over this error.
Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
,AccountId
from Contact
where AccountId in :acctIds and Name != null and Contact_Type__c includes ('Technical Contact')]);
ApexTrigger: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null) 2. 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)
I have searched so many blogs in google , what ever they suggested in that blog are there in this query , eventhough i dont know why i am getting this error.
If any one have any idea on this , please Kindly help me over this error.
The problem is with Name or Contact_Type_c conditions in query(more probably with Name). One way to tackle this is remove those from query and filter irrelavant records in code. See if it can help?
Thanks,
Y.Srinivas