开发者

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.

  1. Should I change the index on the table to be against the foreign key?
  2. 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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜