top of page

Indexes on foreign keys

  • Adam Thurgar
  • Oct 16, 2018
  • 1 min read

SQL Server automatically creates a clustered index on a primary key column/s.

You can change this to be a non clustered index if required, maybe there is a better choice for the clustered index.

When you create a foreign key, nothing happens except the building of the PK/FK relationship.

Should creating a FK also create a non clustered index. I think that it should.

This could help query performance, especially joins.


 
 
 

Recent Posts

See All
Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a...

 
 
 
Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response...

 
 
 
Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete...

 
 
 

Comments


bottom of page