SQL: Should foreign keys be indexed in SQL Server?
If I create a primary key (let’s say a CustomerID in a Customers table) in SQL Server, an index is automatically created to support that key. Primary keys must be unique and not null. SQL Server uses that index to ensure that the key is unique. Keep in mind that when I say “key”, I’m referring to one or more columns, not necessarily just one.
The same happens for unique keys. Again, it makes it easy for SQL Server to ensure the uniqueness.
2018-12-03

