What is the disadvantage of having more foreign keys
There is no any disadvantage in particular and in fact it supports the referential integrity which is the major advantage.
But internally when there is a foreign key means there is a overhead on the SQL Server system:
Before delete a master record, the engine will look at the existence of the child record in foreign key table internally and to insert or updating a primary key on child record; the engine will look into the master record in the primary key table
Conclusion: so ,it’s always better to create a clustered index on the primary key and a non-clustered index on a foreign key
No comments:
Post a Comment