Linked by Thom Holwerda on Fri 7th Dec 2007 19:44 UTC, submitted by Bill Davenport
Thread beginning with comment 289456
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Question: Compound primary keys in Rails?
by borker on Fri 7th Dec 2007 23:08
in reply to "RE: Question: Compound primary keys in Rails?"
I've always felt slightly off about creating an arbitrary unique value unrelated to the actual context of the data when there is already available a way of uniquely identifying rows that only uses actual system data.
Also, by default most DBs create an index on the primary key, which is a bit meaningless with a created single key when most/all data access will still be by what would otherwise be the compound primary key. Just means you have to create an additional index, i realize, but there ya go.
So no real technical show stoppers, just a couple of things that kinda run against the grain for me anyway...






Member since:
2005-11-11
It still doesn't.
But why do you need compound primary keys? What are its advantages over using a number? I've never felt the need to use compound primary keys.