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?
  • Thanks


    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/

    链接地址: http://www.djcxy.com/p/76302.html

    上一篇: 主键和外键同时进行

    下一篇: 将大型表上的外键编入索引的最佳做法