Re: Functional Dependencies > Uniqueness Constraints
Date: Wed, 30 Aug 2006 11:42:12 +0200
Message-ID: <ed3mlh$i3e$1_at_orkan.itea.ntnu.no>
Marshall wrote:
> Okay, fine. I propose that a good relational DBMS should
> not have any special feature for enforcing uniqueness constraints.
> Instead, it should be able to record and enforce functional
> dependencies.
I'd rather say that an RDBMS should be able to reason about FDs. Uniqueness constraints are convenient, and conceptually simpler than FDs, and half the point of normalisation is to enable all FDs to be specified as uniqueness constraints / keys.
But what exactly do you mean? That the DDL of the DBMS shouldn't include the concept of uniqueness constraints? And/or that the DBMS shouldn't bother optimising the enforcement of FDs that correspond to keys (i.e. where the closure is the entire relvar heading)?
> (And of course there must be a rule that
> says every base table must have at least one functional
> dependency in which the union of the determinant set
> and the dependent set equals the set of attributes. (This
> restriction is sufficient to ensure every base table is a
> relation; is it necessary?))
No more (or less) necessary than a rule that any relvar must have at least one key specified.
> Why? Because uniqueness constraints by themselves
> don't capture enough meaning.
>
> Example:
>
> Relation R1(a,b) with FD {a} -> {b}
> Relation R2(c,d) with FD {c} -> {d}
>
> Derived relation J = R1 join R2
> (this join is a cross product)
>
> FDs in J:
> {a} -> {b}
> {c} -> {d}
>
> What if we had just recorded uniqueness constraints in R1
> and R2 (on a and c respectively?) We can't express anything
> derived from those uniqueness constraints in J, at least not
> as uniqueness constaints anyway.
-- JonReceived on Wed Aug 30 2006 - 11:42:12 CEST