Custom indexes are database indexes created on custom fields in Salesforce to improve query performance, especially when working with large data volumes. By indexing a field, Salesforce can retrieve records more efficiently when that field is used in filters, such as in SOQL queries, reports, or list views, reducing query time and avoiding performance issues.
Change sets are a Salesforce deployment tool used to move configuration (metadata) from one org to another, typically from a sandbox to a production environment. They let you bundle components like objects, fields, flows, Apex classes, and custom indexes, and deploy them without external tools. This article explains which custom indexes can, and cannot, be deployed with a change set.
This article explains which custom indexes can be copied between Salesforce orgs using change sets, and which cannot, so you know when to use a change set versus asking Salesforce Support to create an index directly.
Custom indexes are database indexes created on custom fields in Salesforce to improve query performance, especially when working with large data volumes. By indexing a field, Salesforce can retrieve records more efficiently when that field is used in filters, such as in SOQL queries, reports, or list views, reducing query time and avoiding performance issues.
Change sets are a Salesforce deployment tool used to move configuration (metadata) from one org to another, typically from a sandbox to a production environment. They let you bundle components like objects, fields, flows, Apex classes, and custom indexes, and deploy them without external tools.
In an outbound change set, select "Custom Index" (English org language only) from the Component Type picklist to add existing indexes to your change set. See Components Available in Change Sets for background on change set components.
As of July 2023, not every custom index can be copied using change sets. Custom indexes fall into three categories: those that do not need to be copied, those that can be copied, and those that cannot be copied. Each is explained below with examples. See also the known issue: Certain types of Custom Indexes are not available in Change Sets.
When you enable either the "Unique" or "External ID" option for a field, Salesforce automatically creates an index for it. Since these indexes are generated automatically in every org, you do not need to copy them with a change set.
| 1st Column | 2nd Column | Change Set Copyability |
| Custom Field (with "Unique" and/or "External ID" option enabled), automatically created | None | Not copiable (no need to copy) |
A single index on a custom field with neither "Unique" nor "External ID" enabled can be copied via change sets. A two-column custom index where the first column is a custom field with neither option enabled can also be copied, regardless of the second column's type.
| 1st Column | 2nd Column | Change Set Copyability |
| Single Index: Custom Field (neither "Unique" nor "External ID") | None | Copiable |
| Two-column: Custom Field (neither "Unique" nor "External ID") | Standard Field | Copiable |
| Two-column: Custom Field (neither "Unique" nor "External ID") | Custom Field (neither "Unique" nor "External ID") | Copiable |
| Two-column: Custom Field (neither "Unique" nor "External ID") | Custom Field (with "Unique" and/or "External ID") | Copiable |

A two-column custom index where the first column is a custom field with only the "Unique" option enabled can also be copied via change sets, regardless of the second column's type.
| 1st Column | 2nd Column | Change Set Copyability |
| Two-column: Custom Field (with "Unique" option) | Standard Field | Copiable |
| Two-column: Custom Field (with "Unique" option) | Custom Field (neither "Unique" nor "External ID") | Copiable |
| Two-column: Custom Field (with "Unique" option) | Custom Field (with "Unique" and/or "External ID") | Copiable |
A two-column custom index where the first column is a custom field with the "External ID" option enabled and the second column is also a custom field can be copied via change sets.
| 1st Column | 2nd Column | Change Set Copyability |
| Two-column: Custom Field (with "External ID" option) | Custom Field (neither "Unique" nor "External ID") | Copiable |
| Two-column: Custom Field (with "External ID" option) | Custom Field (with "Unique" and/or "External ID") | Copiable |

The following index types cannot be copied using change sets. If you need one of these created, request it from Salesforce Support instead. When deploying custom objects or fields with custom indexes from sandbox to production, these indexes must be manually recreated, since they don't deploy automatically via change sets. When you create an outbound change set and select the "Custom Index" component, these non-copiable index types won't appear in the list of existing index names to choose from.
| 1st Column | 2nd Column | Change Set Copyability |
| Single Index: Standard Field | None | Not copiable |
| Two-column: Standard Field | Standard Field | Not copiable |
| Two-column: Standard Field | Custom Field (neither "Unique" nor "External ID") | Not copiable |
| Two-column: Standard Field | Custom Field (with "Unique" and/or "External ID") | Not copiable |
| Two-column: Custom Field (with "External ID" option) | Standard Field | Not copiable |
000395981

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.