3 ms·
> Foreign keys don't need indexes on the from side Yes, they're not a hard requirement. However, be aware that any field with a foreign key constraint will be
by mfenniak 13y ago
> Foreign keys don't need indexes on the from side
Yes, they're not a hard requirement. However, be aware that any field with a foreign key constraint will be searched during a DELETE that affects the related table, to check RESTRICT DELETE or CASCADE DELETE constraints. It can be very beneficial to performance to have an index on that field for those internal database searches.
The same is true for an UPDATE that affects the PK, but that's relatively rare if you're using surrogate primary keys.