Indexes on foreign keys are not always required. But I recommend to create the indexes on foreign keys when: 1) There are deletions on the parent table and 2) the child table is large.
It has happened to me a few times when deleting from the parent table, it was kind of hanging even there were no associated records in the child table. And when looking at the execution plan, it wouldn't show anything about the foreign key validation to the child table. After adding the indexes the deletions finished instantly.
No comments:
Post a Comment