Indexing in Salesforce

Salesforce supports custom indexes to speed up queries, and you can create custom indexes by contacting Salesforce Customer Support by creating a Case.

Note: The custom indexes that Salesforce Customer Support creates in your production environment are copied to all sandboxes that you create/refresh from that production environment.

The Salesforce platform maintains indexes on the following fields for most objects.

  1. RecordTypeId
  2. Division
  3. CreatedDate
  4. Systemmodstamp (LastModifiedDate)
  5. Name
  6. Email (for contacts and leads)
  7. Foreign key relationships (lookups and master-detail)
  8. The unique Salesforce record ID, which is the primary key for each object

Salesforce also supports custom indexes on custom fields, except for multi-select picklists, text areas (long), text areas (rich), non-deterministic formula fields, and encrypted text fields.

External IDs cause an index to be created on that field, which is then considered by the Force.com query optimizer.

You can create External IDs only on the following fields.

  1. Auto Number
  2. Email
  3. Number
  4. Text

To create custom indexes for other field types, including standard fields, contact Salesforce Customer Support by creating a Case.

By default, the index tables do not include records that are null (records with empty values). You can work with Salesforce Customer Support to create custom indexes that include null rows. Even if you already have custom indexes on your custom fields, you must explicitly enable and rebuild them to get the empty-value rows indexed.

List Views, Reports and SOQL performances will be improved if we use Indexed field in the Filter.

Leave a Reply