Databases Reference
In-Depth Information
exp1
PL /* defining view VPL1 */
exp2
PL INTERSECT ( PL UNION PK ) /* defining view VPL2 */
Observe that the defining expressions exp1 and exp2 here are logically equivalent (i.e., exp1
exp2 is a tautology—as a matter of fact, it's a specific illustration of the first tautology in the list
I gave above). At any given time, therefore, VPL1 and VPL2 certainly both have the same
value; in fact, they both have the same value as the underlying relvar PL does at the time in
question. However, now consider the following delete operations:
DELETE ( P2 ) FROM VPL1 ;
DELETE ( P2 ) FROM VPL2 ;
Of course, these two deletes both have the same effect on the target view as such. As you
can easily confirm, however, the first causes the P2 tuple to be deleted from relvar PL and has no
effect on relvar PK; the second, by contrast, causes that same tuple to be deleted from relvar PL
and—at least according to the rules given in Chapters 9 and 10 for deleting through intersections
and unions— also causes that same tuple to be deleted from relvar PK. So here we apparently
have a case where “the same” update on “equivalent” views certainly doesn't have the same
effect (at least, not on the underlying relvars, although as I've said it does have the same effect
on the views as such).
Now, it's true that to a user who sees view VPL1 or VPL2 (either one) and the underlying
relvars PL and PK as well, the effect of the foregoing deletes on those underlying relvars is at
least explicable—assuming the user in question is also aware of the pertinent compensatory
actions, of course. But the fact remains that the two deletes do have different effects overall.
And the obvious questions remain, too: viz., why do those deletes have different effects overall?
And what are the implications of the fact that they do?
Before I try to answer these questions, consider these insert operations on VPL1 and VPL2:
INSERT ( P7 ) INTO VPL1 ;
INSERT ( P7 ) INTO VPL2 ;
Again the effect on the target view is the same in both cases. However, it's easy to see that
the first insert causes a tuple for part P7 to be inserted into relvar PL and has no effect on relvar
PK, while the second causes that same tuple to be inserted into relvar PL and—again, at least
according to the rules given in Chapters 9 and 10 for inserting through intersections and
unions—also causes that same tuple to be inserted into relvar PK. Again, then, it seems we have
a case where “the same” update on “equivalent” views has different effects, at least on the
underlying relvars.
 
Search WWH ::




Custom Search