Best practice for indexing foreign keys on a large table
I have a large table (SQL Server 2008) with almost 3 million rows. It currently has a clustered index on it's primary key, and a non-clustered index on its foreign key.
Almost all the queries on the table are reads based on the foreign key.
- Should I change the index on the table to be against the foreign key?
- What is the best process for doing this?
Thank开发者_运维百科s
Without knowing more about your situation, I think that changing the non-clustered index to be a non-clustered, covering index would be the best solution.
http://www.simple-talk.com/sql/learn-sql-server/using-covering-indexes-to-improve-query-performance/
精彩评论