Is it a good practice to create an index to every foreing key in my database?
+4
A:
Yes it's a good practice, see here: When did SQL Server stop putting indexes on Foreign Key columns? scroll down to the Are there any benefits to indexing foreign key columns? section
SQLMenace
2010-09-06 10:26:19
+2
A:
Every foreign key? No. Where the selectivity is low (i.e. many values are duplicated), an index may be more costly than a table scan. Also, in a high activity environment (much more insert/update/delete activity than querying) the cost of maintaining the indexes may affect the overall performance of the system.
onedaywhen
2010-09-06 10:56:05
OK. So is there some numeric limit or threshold that may trigger the creation of an index?
GRGodoi
2010-09-06 11:28:38