Hacker News new | ask | show | jobs
by jrochkind1 3339 days ago
I think in general most rdbms require indexes to properly enforce foreign key constraints in a reasonable way.
1 comments

If the parent entities are immutable, or are at least immortal and have primary key values that are immutable, then the DB engine will only need the index on the target primary/unique key/index to maintain the constraint.

Though in general this is not the case, as you say, it is the case often enough that enforcing "FK means an index" could be an annoyance.