It's often a good idea to create an index foreign key columns. This will avoid a full table scan to check referential integrity when rows are deleted form the referenced Line
table and may improve performance of joins between the two tables on LineId
.
I'll add that you may be able to avoid the separate foreign key index with an identifying relationship (assuming a Joint
row cannot exist without a Line
row), where the Joint
table PK is a composite key on LineId
and JointId
. This will help performance of joins between the tables but will not guarantee JointId
alone is unique nor help optimize queries on JointId
alone.