Problem 1
Problem 1
Given relation EMP as in Figure 1, let p1: TITLE < “Programmer” and p2: TITLE >
“Programmer” be two simple predicates. Assume that character strings have an
order among them, based on the alphabetical order.
b) Explain why the resulting fragmentation (EMP1, EMP2) does not fulfill the
correctness rules of fragmentation.
c) Modify the predicates p1 and p2 so that they partition EMP obeying the
correctness rules of fragmentation. To do this, modify the predicates, compose all
minterm predicates and deduce the corresponding implications, and then
perform a horizontal fragmentation of EMP based on these minterm predicates.
Finally, show that the result has completeness, reconstruction and disjointness
properties.
Fig.1.
a) Perform a horizontal fragmentation of relation EMP with respect to {p1; p2}.
EMP2:
ENO ENAME TITLE
E2 M. Smith Syst. Anal.
E5 B. Casey Syst. Anal
E8 R. Davis Mech. Eng.
b) Explain why the resulting fragmentation (EMP1, EMP2) does not fulfill the
correctness rules of fragmentation.
The resulting fragmentation (EMP1, EMP2) does not fufill the correctness and
reconstruction of correctness rules. First the resulting fragmentation does not fulfill
the completeness, because the tuple E4 in the original EMP cannot be found in the
resulting fragmentation EMP1, and EMP2. Furthermore, the resulting
fragmentation does not fulfill the reconstruction requirement. Using the Union
operation in the resulting fragmentation (EMP1, EMP2) cannot reconstruct a
global Relation Emp.
c) Modify the predicates p1 and p2 so that they partition EMP obeying the
correctness rules of fragmentation. To do this, modify the predicates, compose all
minterm predicates and deduce the corresponding implications, and then perform a
horizontal fragmentation of EMP based on these minterm predicates. Finally, show
that the result has completeness, reconstruction and disjointness properties.
Modify p1 and p2 to: P1: TITLE ≤ “Programmer” and P2: TITLE >
“Programmer”
EMP1:
EMP2:
Since the minterm predicates (M2: TITLE > “Programmer” and M3 TITLE
≤“Programmer”) are complete, the resulting fragmentation is complete. All tuples
in the original relation EMP can be found in the resulting relations EMP1, EMP2.
Reconstruction:
Disjointness:
Since the minterm predicate (M2: TITLE > “Programmer” and M3:
TITLE ≤“Programmer” ) are mutually exclusive, the resulting fragmentation is
disjointed. No EMP1 tuple can be found in EMP2, Similarly No EMP2 tuple can
be found in EMP1
Problem 4.
Given relation PAY as in Figure 1, let p1: SAL < 30000 and p2: SAL ≥ 30000 be
two simple predicates. Perform a horizontal fragmentation of PAY with respect to
these predicates to obtain PAY1, and PAY2. Using the fragmentation of PAY,
perform further derived horizontal fragmentation for EMP. Show completeness,
reconstruction, and disjointness of the fragmentation of EMP.
TITLE SALARY
Elect. Eng. 40,000
Syst. Anal. 34,000
Mech. Eng. 27,000
Programmer 24,000
PAY can be decomposed into two parts into PAY1 and PAY2 using these minterm
predicates.
PAY1:
TITLE SALARY
Mech. Eng. 27,000
Programmer 24,000
TITLE SALARY
Elect. Eng. 40,000
Syst. Anal. 34,000
Then EMP can be decomposed based on the fragmentation of PAY:
Completeness:
We claim that all tuples in the original relation EMP can be found in the resulting
relations EMP1, EMP2. Otherwise, we have an eEMP, but e EMP1 e
EMP2, which leads to the following contradiction:
a) EMP is the member relation of a link whose owner is PAY.
b) PAY is fragmented as HFPAY={PAY1, PAY2}.
c) TITLE is the join attribute between EMP and PAY. Then, for each tuple
eEMP, there is a tuple e’PAY such that
e[TITLE] = e’[TITLE]
However, e’ PAY1 e’ PAY2. Thus, e’ EMP1 (= EMP semi-join PAY1)
e’ EMP2 (= EMP semi-join PAY2). It is a contradiction.
Reconstruction:
The original global relation EMP can be reconstructed by the union operator on the
resulting fragmentation: EMP1 and EMP2.
HF = {EMP1, EMP2}
EMP = EMP1 EMP2
Disjointness:
We claim that PAY1 and PAY2 do not have any common tuples. Otherwise, we
have at least a e EMP1 e EMP2, which leads to the following contradiction.
e EMP1 e’ PAY1 such that e[TITLE] = e’[TITLE]
e EMP2 e’’ PAY2 such that e[TITLE] = e’’[TITLE]
However, TITLE is the key of PAY. Then, we have e’= e’’. That is, PAY1 and
PAY2 are not disjoint. Contradiction!