-
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

How to Import CSV File To A Table In Salesforce?
There are many scenarios where we have CSV(comma separated values) which we want to process in our Visualforce pages so that further custom functionality can…

Do You Have Skills to Become a Salesforce Developer in 2024?
What is a Salesforce Developer? Salesforce developers are professionals who build functionalities in a sandbox with Visualforce or Apex before handing them over to the…

Why It’s Important To Learn Salesforce In 2021
Salesforce is a popular CRM solution, and that’s normal for all the benefits that it offers. It gives businesses a wide range of tools that…
Popular Salesforce Videos
Tips on Lightning Combo Box, Events in Lightning App Builder, and More
Watch this video by Salesforce Developers to get the tips on Lightning Combo Box, Events in Lightning App Builder, and more. Watch and learn, do…
360 SMS App Demo
360 SMS App is considered to be the most reliable Salesforce SMS App. This App is listed on the AppExchange from the name "360 SMS…
What Is The Approximate Salary A Fresher Can Expect In The Indian Market Of Salesforce?
Wondering what is the approximate salary a fresher can expect in the Indian market of Salesforce? Join this useful group for Salesforce job & career…