Automatic creation of indexes on foreign keys | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Automatic creation of indexes on foreign keys


Hello Every time a PK is declared on a table, a corresponding Index is created automatically. But every time a foreign key is declared, the corresponding Index has to be created manually. Since it is recomended that an index must exist for every FK on a table (unless I am wrong), why the index is not created automatically? I have other question: Strictly speaking, if one wants queries to run fast, are Keys of any use? I mean, is it only required to create appropiate indexes on a table when optimum performance of queries are the objective? Thanks a lot.
Check the following…
http://www.sqlskills.com/blogs/kimb…verStopPuttingIndexesOnForeignKeyColumns.aspx
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

– also there’s more to a table, than just having persistent data !
– a db also has metadata ! At least as important as the data itself, especialy in the beginning of a data-project or at mergery/adaption time.
]]>