locked
Using Foreign Keys in indexing RRS feed

  • Question

  • Hi,

    I'm studying a SQL Server book that recommends use of Foreign Keys in indexing. I want to know reason of this idea.


    Thanks.
    MJ_Developer.
    Monday, January 4, 2010 9:38 PM

Answers

  • It is helpful to index the keys that are used in a foreign key relationship. This way the the query engine has to check for the existence of the key, it does not have to do a table scan.

    Foreign keys by them selves have no part in indexing, ie you must place indexes on them.

    looking for a book on SQL Server replication? http://www.nwsu.com/0974973602.html looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941
    • Marked as answer by KJian_ Tuesday, January 12, 2010 10:38 AM
    Tuesday, January 5, 2010 11:19 AM