3 ms·
> His mySQL tables used no foreign keys, only int fields. This one is potentially justifiable if speed is a higher priority than data integrity.
by jniedrauer 7y ago
> His mySQL tables used no foreign keys, only int fields.
This one is potentially justifiable if speed is a higher priority than data integrity.
- pier25 7y agoOk, but no, this was incompetence. The application he managed had around 10k users that used it a couple of times per year.
- redis_mlc 7y agoMost MySQL applications don't use FKs. The world keeps turning. Besides performance issues, FKs cause ordering issues with restoring tables when necessary. However, they're great for diagramming tools to show table relationships. I'm more concerned when I don't see unique indexes on things that need to be unique (often caused by early versions of RoR.) In my experience, this is never a theoretical problem - it always becomes a major operational problem. Source: MySQL DBA
- cookiecaper 7y agoAlso, depending on how long ago this was, may not have been as bad as it sounds -- MyISAM doesn't support foreign keys, and it was the default all the way until MySQL 5.5 in 2010.