Database Reference
In-Depth Information
takes up storage. On the other hand, once a view
is materialized, we have to take care of the main-
tenance problem (cf. Section 3). Materializing
views can benefit query response time at a cost
of increasing storage and maintenance overhead.
It is interesting to note that query response time
degrades with too much extra view materializa-
tion. Kotidis (2002) attributes the phenomenon
to the competition of memory buffers among
materialized views.
GROUP BY part, R.cust, C.nationkey;
In order to maintain the view after an update
to the base relations R or Customer , we can dis-
tinguish the following cases:
A tuple is inserted, deleted or modified in
R .
A tuple is inserted, deleted or modified in
Customer .
The effect of the updates to base relations of the
materialized view can be computed by rewriting
the definition of view V 1 using relations repre-
senting only the inserted and deleted tuples from
the base relations. For simplicity, we represent a
modification of a tuple as deletion followed by
an insertion, knowing that this representation is
inaccurate and might be inefficient. There are
maintenance methods which consider modifica-
tions separately (Urpí and Olivé, 1992). To keep
the example simple, we just focus on the join
between R and C in the view V 1 :
The insertions to V 1 can then be computed by
the expression:
vIeW MAIntenAnce
View maintenance is the process of updating a
materialized view after the base tables, from which
the view has been derived, have been updated
(Gupta and Mumick, 1995).As the recomputation
of the views from scratch is usually too expensive,
incremental methods are used to compute the
changes to the view which result from changes
of the base data. However, in some special cases
(e.g., update or deletion of a complete relation)
it might be more efficient to recompute the view
from scratch instead of using an incremental view
maintenance method. In the following, we will
refer to incremental view maintenance methods
when speaking about view maintenance.
We first introduce the problem in Section
3.1, before we discuss several view maintenance
methods in more detail according to a classifica-
tion in Section 3.2.
V 1, ins = R ins C R C ins
where R ins and C ins represent the tuples inserted
into R and C , respectively, and R' denotes the
relation R after the update (e.g., including newly
inserted tuples and old tuples) (Hanson, 1987; Ceri
and Widom, 1991; Gupta et al., 1993).
In a similar way, the deleted tuples from V 1
can be computed as:
description of the view
Maintenance Problem
V 1, del = R del C R C del
Consider Example 1 from Section 2. Suppose
we want to group customers in view V 1 by nation
for which we have to join the table R with the
customers table:
SELECT R.part, R.cust, C.nationkey,
SUM(sales) AS total
FROM R, Customer as C
WHERE R.cust=C.custkey
Please note that the set of deleted tuples of a
relation is only joined with the former state of the
other relation in order to get the deleted tuples of
the join relation.
Then the new state of the view V 1 can be
computed as:
Search WWH ::




Custom Search