Databases Reference
In-Depth Information
that time). We cannot simply insert a tuple to that effect, for if we
did so the result would violate the COALESCED requirement
twice. In fact, what we have to do is delete one of the existing S2
tuples and update the DURING value in the other to [d02,d10 ].
UPDATE: Suppose we discover that S2s status was temporarily
increased on day 9 to 20. It is quite difficult to make the required
change, even though it sounds like a simple UPDATE. Basically, we
have to split S2s [d07,d10 ] tuple into three, with DURING values
[d07,d08 ], [d09,d09 ], and [d10,d10 ], respectively, and with other
values unchanged, and then replace the STATUS value in the
[d09,d09 ] tuple by the value 20.
·
DELETE: Suppose we discover that supplier S3s contract was ter-
minated on day 6 but reinstated on day 9. Again, the required update
is nontrivial, requiring the single tuple for S3 to be split into two, with
DURING values of [d03,d05 ] and [d09,d10 ], respectively.
·
Observe now that the solutions we have just outlined to these three problems
are specific to the current value of relvar S_DURING (as well as to the particu-
lar updates desired). Consider the insert problem, for example; in general, a
tuple considered for insertion might just be insertable as is, or it might
need to be coalesced with a preceding tuple, a following tuple, or (as in
our example) both. Analogously, updates and deletions in general might or
might not require the splitting of existing tuples.
It is clear that life will be unbearably complicated for users if they are
limited to the conventional INSERT, UPDATE, and DELETE operations;
some extensions are clearly desirable. Here then are some possibilities:
INSERT: Actually, the INSERT problem can be solved by simply
extending the semantics of the COALESCED specification on
the relvar definition appropriately. To be specific, we can permit the
INSERT to be done in the normal way and then require the system
to do any needed (re)coalescing following that INSERT. In other
words, the COALESCED specification no longer merely defines
a constraint, it also includes certain implicit compensating actions
(analogous, somewhat, to referential actions on foreign key specifi-
cations).
Unfortunately, however, extending the semantics of
COALESCED in this way is not sufficient in itself to solve the
UPDATE and DELETE problems.
·
Search WWH ::




Custom Search