Databases Reference
In-Depth Information
u
i
i
r
r
d
d
Fig. 2.2: The delete set d and the insert set i
Of course, the delete set d might be empty, in which case the original assignment is
effectively a pure INSERT operation. Or the insert set i might be empty, in which case it's
effectively a pure DELETE operation. Or they might both be empty, in which case the
assignment overall effectively degenerates to the “no op” R := R .
It follows from all of the above that the original assignment R := rx is in fact logically
equivalent to the following multiple assignment (see “Multiple Assignment” on page 18 for
further discussion of this latter construct): 7
DELETE d FROM R , INSERT i INTO R
As a consequence, although I said earlier that assignment as such is really the only update
operator we need, we can always (and for intuitive reasons, at least, it turns out to be convenient
to do this) think in terms of DELETE and INSERT operations instead. That is, faced with an
arbitrary and possibly multiple assignment to relvar R —including in particular the case where
the assignment in question is formulated as an explicit UPDATE on R —I propose that we map
that assignment to a DELETE on R and an INSERT on R , where the delete set d and the insert
set i are well defined, disjoint, and unique. Note: Because of this state of affairs, in what
follows I'll discuss explicit UPDATE operations only when there's something interesting to say
about them. Also, I'll ignore for the most part the practical problem of actually computing d and
i. My primary concern, in this topic as in most of my other writings, is always to get the theory
right first before worrying about issues of implementation. Of course, I don't mean to suggest by
these remarks that I think implementation issues are unimportant. Au contraire , in fact—
checking feasibility of implementation is crucial to ensuring the correctness of the theory.
7 The actual Tutorial D syntax for this multiple assignment would be DELETE R d , INSERT R i .
Search WWH ::




Custom Search