Custom indexes, when used improperly, can slow query results rather than improve them. It is best to create filter conditions that are selective so the Salesforce Force.com query optimizer scans only the rows necessary in the targeted objects. The Force.com query optimizer does not use an index to drive queries that contain non-selective filter conditions, even if the fields in those filter conditions already have indexes.
Before requesting a custom index from Salesforce Support, review the resources below to determine whether adding selective filters to your SOQL (Salesforce Object Query Language) query can resolve the performance issue without a custom index.
This article explains how to improve SOQL query performance in Salesforce through query selectivity, which self-service steps to try first, and which details to include in a Salesforce Support case when you request a custom index.
Review these self-service options before submitting a custom index request:
Include the following information in your Salesforce Support case. Each item is required for Support to evaluate and implement the index correctly:
When you provide your SOQL query, include the actual bind value, not an Apex variable. The following two examples show the difference.
Correct: SELECT Id, Case_Number__c FROM Case WHERE Severity__c = 'Critical'. Support can run this query directly.
Incorrect: SELECT Id, Case_Number__c FROM Case WHERE Severity__c = :severityLevel. Support cannot execute Apex variable references.
000387172

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.