r/learnSQL • u/squadette23 • 17d ago
ID design and composite primary keys, pt. III
I've been writing a series of posts on ID design and primary keys, and just published the third part: https://anchorsandlinks.com/posts/primary-keys-3/. It discusses a well-known pattern of composite primary keys in entity tables. It is relatively rarely used, and the text explains why. This pattern can only be used when several criteria are satisfied, and it may become an obstacle when business requirements change. The rationale for using composite primary keys is that it can give performance improvements in some scenarios.
1
Upvotes
2
u/Ultra-Ferric 17d ago
I took a brief look at your article and I believe you have a fundamental misunderstanding of the relational model.
A Reddit thread can’t fill this gap, but I highly recommend that you begin by reading the works of Chris J. Date, Fabian Pascal, and Joe Celko (to name a few) and avoid perpetuating this unfortunate, yet common misinformation about keys and identifiers.
Here’s a free short article by Celko, one of the members of the SQL 92 advisory committee, that may crack open the hatch for you, and other data practitioners:
https://www.informationweek.com/data-management/celko-on-sql-identifiers-and-the-properties-of-relational-keys