Below we illustrate the maintenance anomaly problem by a motivating
example. Assume we have four data sources with one relation each as shown
DS1: Customer(Name, Address, Phone)
DS2: Tour(TourID, TourName, Age, Type, NoDays)
DS3: Participant(Participant, TourID, StartDate, Loc)
DS4: FlightRes(Name, Age, FlightNo, Source, Dest)
The view Asia-Customer is defined as:
SELECT C.Name, F.Age, F.FlightNo, F.Dest, T.TourID
FROM Customer C, FlightRes F, Tour T
WHERE F.Dest = 'Asia' AND F.Name = T.Tourname
Assume the data update ``insert into Customer values(`Ben',`MA',123456)''.
In order to determine the delta effect on the view extent, the view
manager generates the incremental view maintenance query Q below
by decomposing the view query into individual source queries to each data
Maintenance Query Q:
SELECT 'Ben' as Name, F.Age, F.FlightNo, F.Dest
FROM FlightRes F
WHERE F.Name = 'Ben' AND F.Dest = 'Asia'
Two different types of anomaly problems can be distinguished:
(a) Duplication Anomaly: If during the transfer time of the
query Q to the relation FlightRes in the DS4, FlightRes has committed a
new data update "insert (`Ben', 18,`AA3456',`Asia')".
This new tuple would also be included in the join result of Q. After
querying over relation Tour similarly, one possible final tuple (`Ben',
18, `AA3456',`Asia') would be inserted into the view. However, later when
the view manager processes
the same tuple would be inserted into the view again. A
duplication anomaly appears, as also observed by .
(b) Broken Query Anomaly: During the transfer time of query Q to
DS4, the FlightRes relation has just been decomposed and normalized to
two relations FlightRes (Name,Age,FlightNo) and
Then the maintenance query Q faces a schema conflict, i.e., the selected
is no longer available in the FlightRes relation. Thus the maintenance
from the out-of-date view definition cannot be processed by DS4 due to
the inconsistency between the schemata specified in the query (``F.Dest'')
and the schema of the underlying source (no such attribute). We then say
that the query Q is broken.