Databases Reference
In-Depth Information
One difficulty with this approach is as follows: On what basis do we decide to use surrogates for
(SNO,CNO) combinations and not for (CNO,TNO) combinations or (TNO,SNO) combinations? Whichever choice
we make is asymmetric. Moreover, surrogates are not without problems of their own. Here are some of them: 17
Surrogates can make updating more complicated (in essence, users have to do their own foreign key
checking).
To add insult to injury, the system's foreign key checking─which still has to be done!─(a) will never fail and
(b) will therefore be pure overhead.
Queries and updates become longer, more tedious to write, more error prone, harder to debug, and harder to
maintain.
More integrity constraints become necessary.
For present purposes, however, the real question is this: Does introducing surrogates really serve to reduce
redundancy? I don't want to try to address this question here; I'll come back to it later, in the section “Refining the
Definition.”
EXAMPLE 10
Another tactic we might consider for reducing redundancy in examples like that of Fig. 15.7 is to introduce some
relation valued attributes or RVAs. Fig. 15.9 below gives an example. However, one obvious problem with this
approach─quite apart from all of the usual problems that always attend the use of RVAs─is again asymmetry: On
what basis do we decide to use an RVA for tutors and not for students or courses? And in any case, does this tactic
really reduce redundancy? Again I'll come back to this question later, in the section “Refining the Definition.”
┌─────┬─────┬─────────┐
│ SNO │ CNO │ TNOREL │
├═════┼─────┼─────────┤
│ │ │ ┌─────┐ │ │ │ │ ┌─────┐ │
│ S1 │ C1 │ │ TNO │ │ │ S1 │ C2 │ │ TNO │ │
│ │ │ ├═════┤ │ │ │ │ ├═════┤ │
│ │ │ │ T1 │ │ │ │ │ │ T1 │ │
│ │ │ │ T2 │ │ │ │ │ └─────┘ │
│ │ │ └─────┘ │ │ │ │ ┌─────┐ │
│ │ │ ┌─────┐ │ │ S2 │ C2 │ │ TNO │ │
│ S2 │ C1 │ │ TNO │ │ │ │ │ ├═════┤ │
│ │ │ ├═════┤ │ │ │ │ │ T1 │ │
│ │ │ │ T1 │ │ │ │ │ └─────┘ │
│ │ │ │ T2 │ │ └─────┴─────┴─────────┘
│ │ │ └─────┘ │
Fig. 15.9: Using an RVA for tutors
17 These problems are elaborated in my paper “Composite Keys” in Relational Database Writings 1989-1991 (Addison-Wesley, 1992).
Search WWH ::




Custom Search