function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Uday KUday K 

"Non-selective query against large object type (more than 100000 rows)". Consider an indexed filter

Hello All,


I am getting the following exception in my trigger. I understood about this exception error and i tried many ways.

I am getting exception in this query.

can someone help me.

 

lContactPh = [Select Id,Phone,Format_Phone__c,Email,Personal_Email__c,Other_Email__c,AccountId from Contact Where Format_Phone__c  != null AND Format_Phone__c IN:phoneList ORDER BY CreatedDate DESC Limit 5000];

 

Format_Phone__c  is a formula field to populate the phone without format to use in query.

I tried to create unique field so that i can give in Where filter, But unfortunately the unique field limit is also exceeded.

I have more more that 2,50,000 contacts in my organization.

 

Thanks,

Uday

 

sfdcfoxsfdcfox
You can ask support to have the Format_Phone__c field to have a custom index (assuming it is not a cross-object formula). Try it and see what happens.