In Salesforce, the following fields are automatically indexed:
Primary Key Fields:The primary key fields in Salesforce, such as the Id, Name, and Owner fields are automatically indexed. These fields are used to uniquely identify records in the system.
Foreign Key Fields:The foreign key fields in Salesforce, such as lookup or master-detail relationship fields, are also automatically indexed. These fields are used to establish relationships between records in different objects.
Audit Dates:The audit dates in Salesforce, such as SystemModStamp, are automatically indexed. These fields are used to track when a record was last modified.
Custom Fields marked as External ID or Unique:Custom fields that are marked as External ID or Unique are automatically indexed. These fields are used to enforce uniqueness constraints on records.
It is important to note that while these fields are automatically indexed, indexing may not always be sufficient to ensure optimal performance in queries and searches.