You need to sign in to do that
Don't have an account?
SaravanaBharathi-SB
Reg:system.queryexception Non-Selective query with large object type
Have trigger to check duplicate with certain parameters
Query is:
(Select id from x__c where (((a__c = request.a__c) and (b__c =request.b__c) and (c__c = request.c__c) and (lastmodifieddate>=system.today) limit 1);
X__c is the object having 1,75,000 records. For satisfying this condition, its having only 5 records,
The same query, ran in the developer console,controller its running successfully.
When i run this query in the trigger, its throwing error.
Could any one help on this? Please..:(
when you are querying againest a large volume of data , its always advisable to turn the indexing filter on.
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm
http://forums.sforce.com/t5/Apex-Code-Development/Query-Error-quot-System-QueryException-Non-selective-query/td-p/64029
Thanks for you reply,
But we dont have any external Id for the filtered fields.. Then how to resolve this.
you can turn it on at the field level, but if it's in prod you need to work with salesforce support.