Re: candidate keys in abstract parent relations
- From: zeldorblat@xxxxxxxxx
- Date: 18 Jan 2006 22:20:17 -0800
Forrest L Norvell wrote:
> Is there a method to generate a primary key based on entities that are
> children of a parent relation (and if there is, is it all a good idea
> to use it?)? Is the Album an overly-abstract construct that should be
> pushed into the Tracks and Releases? Or am I being overly finicky and
> should I just write a sequence generator / use an autoincrementing
> column? In the real world, labels issue the same Album at different
> times on different formats in different Locales that are struck from
> the same masters with the same name (but as separate Releases) and the
> same Recordings on the Release, and I think most people would
> intuitively understand the relationships as I've sketched them out
> above, as well as intuitively understanding that two albums with the
> same title and artist can, on occasion, contain different Tracks, and
> therefore do not share the same identity.
>
> Any hints on what I should look at next?
In a nutshell, you're being overly finicky. Why are you so afraid of
an auto-incrmenting surrogate key column? They makes joins cleaner,
faster, and easier. In general, they makes things more legible.
There's nothing wrong with defining additional unique constraints on
your data either, even when using a surrogate key. I think you'll find
in practice that it's quite common.
.
- Follow-Ups:
- Re: candidate keys in abstract parent relations
- From: Forrest L Norvell
- Re: candidate keys in abstract parent relations
- References:
- candidate keys in abstract parent relations
- From: Forrest L Norvell
- candidate keys in abstract parent relations
- Prev by Date: Re: MV and SQL
- Next by Date: Re: Announcing New Blog
- Previous by thread: candidate keys in abstract parent relations
- Next by thread: Re: candidate keys in abstract parent relations
- Index(es):