144 Automated Physical Database Design and Tuning
we denote V
M
= V
1
⊕ V
2
as the merging of V
1
and V
2
when the following
properties hold:
1. C
1
(V
M
) ≡ V
1
and C
2
(V
M
) ≡ V
2
for some SQL fragments C
1
(V
M
) and
C
2
(V
M
).
2. If the view-matching algorithm matches V
1
or V
2
for a subquery q,it
also matches V
M
for q (a view-matching algorithm matches a view V
for a subquery q if q can be answered from V ).
3. V
M
cannot be further restricted with additional predicates and continue
to satisfy the previous properties.
8.2.2.1 Case 1: No Grouping Columns
Consider merging V
1
= (S
1
, T, J
1
, R
1
, Z
1
, ∅) and V
2
= (S
2
, T, J
2
, R
2
, Z
2
, ∅).If
the merging language were expressive enough, we could define V
1
⊕ V
2
as
SELECT S
1
∪ S
2
FROM T
WHERE (J
1
AND R
1
AND Z
1
)OR(J
2
AND R
2
AND Z
2
)
which satisfies properties ...