-
Non-selective query against large object type (more than 100000 rows)
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)The above error occurs in production where we have approx 138000 records. We have couple of methods to get this rectified like optimizing the query, null check, making the field external id or unique. Somehow the query Threshold value goes out of the limit that is why the query is not selective. Any help would be appreciated.
Log In to reply.
Popular Salesforce Blogs
![](https://images.forcetalks.com/wp-content/uploads/2023/05/02091524/Blog-banner-Sep-2022-2023-06-02T144457.060.png)
Top 5 Benefits of Salesforce Commerce Cloud
As the number of online shoppers continues to increase rapidly, businesses must adapt to this growing market. To attract customers and expand their online presence,…
![](https://images.forcetalks.com/wp-content/uploads/2021/06/30105508/sa_1625050492salescloudvsservicecloud_01cover.png)
Which Salesforce Tool Should You Be Using? Sales Cloud vs. Service Cloud
You have offered two module alternatives when you join up for Salesforce: Sales Cloud or Service Cloud. Generally speaking, users in Service Cloud are focused…
![What is the Salesforce Guidance Center in 2023? | The Trailhead Guide](https://images.forcetalks.com/wp-content/uploads/2023/02/10131049/Blog-banner-Sep-2022-43-1.png)
What is the Salesforce Guidance Center in 2023? | The Trailhead Guide
The Guidance Center is a one-stop shop for learning and enablement in the flow of work. Learning is both recommended to users automatically by Salesforce…
Popular Salesforce Videos
Before Delete Trigger in Salesforce Flows - Winter '21 update
In this video, I'm talking about one of the new features of the Salesforce Winter '21 flow builder i.e is before delete trigger. Watch and…
Future of Salesforce Jobs | The Shrey Sharma Show
Salesforce saw a 38% rise in its jobs listings from 2020-2021 and 4.2M jobs will be created in the Salesforce ecosystem by 2024. Watch the…
Career in Salesforce in 2022
In this video, Shrey is talking about starting your career in Salesforce. Here are the different career choices you have or different profiles that are…