Maybe the title got you a bit curious because there is no such thing as adding indexes in Salesforce Marketing Cloud data extensions. But what can be done instead?
If the indexes cannot be managed by the admins and cannot be requested from support we can try to apply one of the following workarounds.
Filtered data extensions
Every column that is used in a filter (where clause) to create a filtered data extension is automatically indexed in the new filtered data extension.
Adding primary keys
To add indexes, we will have to do so by marking columns as primary keys. A primary key is, so to speak, a type of index and thus it will be indexed
NOTE: Be aware that adding multiple primary keys to the data extension can introduce unwated duplicate rows. As by adding multiple primary keys we are craeting coumpound key.
Relational database model
Additionally, you can add certain index types by adding the data extension to your relational model, where foreign keys are basically, similarly as primary key, index too.
Salesforce support can make an exception
Salesforce support can make exception and will add index to your data extension when:
- process is fully optimised and there are still performance issues
- when using functionality such as ClaimRow() and field cannot be added as primary key in your data extension.