You need to sign in to do that
Don't have an account?
TehNrd
System.QueryException: Non-selective query against large object
I am encountering this error with the following query but I am not
sure why. I thought non selective meant you didn't have a where clause
but this query does.
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)
Thanks.
Message Edited by TehNrd on 10-21-2008 09:47 AM
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)
Code:
for(Opportunity opp : [select Id, Reseller_Company_Name__c, Partner_Level__c, Partner_Engagement_Type__c from Opportunity where Reseller_Company_Name__c IN :coNames AND LastModifiedDate >= :oldestDate]){
String resName = opp.Reseller_Company_Name__c;
Automation__c match = fuzzyNameMatch.get(resName);
opp.Reseller_Company_Name__c = match.Reseller_Company_Name__c;
oppsToUpdate.add(opp);
}
Message Edited by TehNrd on 10-21-2008 09:47 AM
Message Edited by TehNrd on 10-21-2008 04:39 PM
Hi There,
I am facing a similar issue :(
Did you get a reply to your case? In my query, the filter is on a lookup field. So, I can't even make it an ExternalId field!
Any ideas?
Many Thanks,
Cool_D
I never got a super clear answer on this and I can't recall if it was something I did or salesforce did to help the issue. I have found that I usually only get this error in triggers and if i run them asychronously (@future) I don't get this error.
Sorry I couldn't be more help.