Database Reference
In-Depth Information
T )
contains Cartesian prod-
ucts we consider the reduction invalid and stop (a cartesian product does not
provide any e ciency advantage and it is almost always much larger than the
input relations).
The following example illustrates the reduction operator:
V = SELECT R.c, S.c
To avoid irrelevant views, if the resulting
ρ(
V
,
ρ(
V
, {
R
} ) = SELECT R.c, R.b, R.x
FROM R, S
FROM R
WHERE R.x = S.y AND
WHERE 10 < R.a < 50
10 < R.a < 50 AND
GROUP BY R.c, R.b, R.x
20 < S.a < 30 AND
R.b + S.b < 10
GROUP BY R.c, S.c
8.2.4 Indexes over Materialized Views
So far we have discussed the merging and reduction operations applied to
materialized views without paying attention to indexes over those materialized
views. In reality, each materialized view is associated with a set of indexes,
and those indexes are used during query processing. To handle both structures
in a unified manner, we consider all indexes as defined over some view (base
tables are also trivial views, so this definition includes regular indexes as well).
Specifically, an index with columns C defined over view V is denoted as V
)
(when the view V is a base table, this notation agrees with that of indexes
defined over base tables). For the special case C
(
C
to be the
unordered heap containing all the tuples in V (for simplicity, we use V and
V
=∅
, we define V
( )
( )
interchangeably).
8.2.4.1
Unified Merging Operator
We now define the merging of two arbitrary indexes over views. In this section
we overload the operator
to operate over indexes and materialized views
(we explicitly state which case we are referring to when this is not clear from
the context). Merging two indexes defined over the same view is the same
operation that we defined in Section 4.2.2.1 for indexes over base tables. To
address the general case, we need to first introduce the notion of index pro-
motion . Consider an index V
(
)
and suppose that V M =
V for some view
C
V
V . Promoting V
(
)
(
)
V M ) results in an index over V M
that can be used (with some compensating action) whenever V
C
to V M (denoted V
C
is used.
This promoted index contains, in addition to all columns in the original index,
every column that was added to the select clause in V M . For instance, consider:
(
C
)
V 1 = SELECT x,y
V 2 = SELECT y,z
V 1
V 2 = SELECT a,x,y,z
FROM R
FROM R
FROM R
WHERE 10<a<20
WHERE 15<a<30
WHERE 10<a<30
Search WWH ::




Custom Search