You need to sign in to do that
Don't have an account?
china.leaf
Non-selective query against large object type (more than 100000 rows)
this is my code:
List<string> flstImport = new List<string>();
//add items to flstImport
List<InventoryCheckItem__c> flstInventoryCheckItem = [Select i.ImportId__c, i.Id From InventoryCheckItem__c i where i.ImportId__c in : flstImport];
it works well in sandbox, when deploy, i get the error message:
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)
Note:
1.there are 402965 records in table InventoryCheckItem__c.
2.i already set ImportId__c "external ID"
My English is very poor, who can help me!~~~~~
List<string> flstImport = new List<string>();
//add items to flstImport
List<InventoryCheckItem__c> flstInventoryCheckItem = [Select i.ImportId__c, i.Id From InventoryCheckItem__c i where i.ImportId__c in : flstImport];
it works well in sandbox, when deploy, i get the error message:
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)
Note:
1.there are 402965 records in table InventoryCheckItem__c.
2.i already set ImportId__c "external ID"
My English is very poor, who can help me!~~~~~
System.debug('■flstImport■'+flstImport);
■flstImport■(9999999991022722009-1, 9999999991022722009-2);
but table "InventoryCheckItem__c" exist records where ImportId__c is null
is this the reason?
Best Regards