The really bad side of composite keys...
No, I'm not going to talk about the hard to create/understand queries, performance, or maintainability. The really bad side of composite keys is that you get assoications using part of a key. Here is an example:
Now, start working with the associations here. Payments are linked to salaries that falls within their date range and belong to the same employee. Needless to say, this breaks down FK support, so you will end up with bad data that you need to clean. No to mention that they queries that you need against this database are horrendous.
But, the wost thing that I saw was a relation between two tables that relied on the last N left-most unique characters in a string key.
Comments
Comment preview