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
smeehsmeeh 

non-selective query

Operation: insert.Contact

By user/organization: 00520000000vb7q/00D200000000vUt

Caused the following Apex resource warnings:

Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 76265 rows. When the limit is reached, the query will fail. 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)
null
""Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 76265 rows. When the limit is reached, the query will fail. 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)""

now, what is going on here? and how to solve this?
 
Yonathan  GottliebYonathan Gottlieb
Hi,

What is your query ? Can you have or add an index field and filter your query ?

Yonathan G.
Ketankumar PatelKetankumar Patel
What ever field you use in where clause having null
values in it.
  1. Remove null using field__c != null in your query Or
  2. Make that field as an external Id field.
smeehsmeeh
Yonathan/Ketankumar,

I am using an electronic form in  Formassembly to create contact records. Then the resource warnings are created. Now, how to influence the Formassembly/Salesforce integration? Any idea would be highly appreciated.