-
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
![Mobile App for Salesforce](https://images.forcetalks.com/wp-content/uploads/2022/05/13181434/Mobile-App-for-Salesforce.jpg)
Mobile App for Salesforce - Learn All About it Here
The Salesforce mobile app makes all essential information available at the touch of a button, including dashboards and reports, leads and opportunities notifications, and tasks.…
![](https://images.forcetalks.com/wp-content/uploads/2024/05/20095713/sa_1716199028Thumbnail_LinkedIn_Sales_Navigator_Integration_1920_x_1080_px_1%201-1024x576.png)
What Salesforce Einstein Chatbots Can Do? Use Cases Overview for Every Industry
You may have encountered AI chatbots in your lifetime, for leisure or business. Chatbots are not a new concept. Their current surge in popularity reflects…
![Salesforce Texting App](https://images.forcetalks.com/wp-content/uploads/2022/03/09151228/Salesforce-Texting-App.png)
Why Should You Prefer Salesforce Texting App Over Other Business Communication Channels?
In today’s cutthroat business landscape, organizations should not just focus on providing quality products and services but also maintain amiable customer relationships. However, this is…
Popular Salesforce Videos
Mastering Apex Collections | Salesforce Tutorial
Working with collections like List, Map and Set is part of the day’s routine for Apex developers. While their basic use is straightforward, there are…
Tableau CRM for Emergency Response Management | Salesforce
When disaster strikes, public and private health organizations, as well as government agencies, need to respond quickly and efficiently. Tableau CRM for Emergency Response Management…
Creating Multi Screen Wizard Using Apex and Visualforce Salesforce
Watch this video to learn how to create a Multi-screen wizard using Apex and Visualforce Salesforce. If you have any questions do let us know…