Last post Sep 01, 2016 08:03 PM by Mikesdotnetting
Sep 01, 2016 06:03 PM|SpongeBert|LINK
Having unindexed foreign keys can be a performance issue. There are two issues associated with unindexed foreign keys. The first is the fact that a table lock will result if you update the parent records primary key (very very unusual) or if you delete the
parent record and the child's foreign key is not indexed.
1) Is it ok to index all unindexed foreign keys or should we only create indexes on those keys which require indexes because it might cause performance issues?
2) How can you detect if it is a good option to add a index to an unindexed foreign key?
Sep 01, 2016 08:03 PM|Mikesdotnetting|LINK
Generally, you should index foreign keys that are used in WHERE clauses and in joins. That usually covers most, if not all foreign keys in a database.