Vous êtes sur la page 1sur 2

Distributed

Database Systems Assignment #2 Due Date: 17th May 11, 2019


3.2 Distribution Design Issues 77

EMP ASG

ENO ENAME TITLE ENO PNO RESP DUR

E1 J. Doe Elect. Eng E1 P1 Manager 12


E2 M. Smith Syst. Anal. E2 P1 Analyst 24
E3 A. Lee Mech. Eng. E2 P2 Analyst 6
E4 J. Miller Programmer E3 P3 Consultant 10
E5 B. Casey Syst. Anal. E3 P4 Engineer 48
E6 L. Chu Elect. Eng. E4 P2 Programmer 18
E7 R. Davis Mech. Eng. E5 P2 Manager 24
E8 J. Jones Syst. Anal. E6 P4 Manager 48
E7 P3 Engineer 36
E8 P3 Manager 40
PROJ PAY

PNO PNAME BUDGET LOC TITLE SAL

P1 Instrumentation 150000 Montreal Elect. Eng. 40000


P2 Database Develop. 135000 New York Syst. Anal. 34000
P3 CAD/CAM 250000 New York Mech. Eng. 27000
P4 Maintenance 310000 Paris Programmer 24000

Problem#1
Given relation EMP as in Figure , let p 1: TITLE < “Programmer” and p
Fig. 3.3 Modified Example Database 2: TITLE > “Programmer” be two simple
predicates. Assume that character strings have an order among them, based on the alphabetical order.
budgets are less than $200,000, whereas PROJ2 stores information about projects
1. (a) Perform a horizontal fragmentation of relation EMP with respect to { p
with larger budgets. 1 , p2 ⌥
}.
2. (b) Explain why the resulting fragmentation (EMP1 , EMP2 ) does not fulfill the correctness rules
of fragmentation.
Example 3.2. Figure 3.5 shows the PROJ relation of Figure 3.3 partitioned vertically
3. (c) Modify the predicates p
into two subrelations, PROJ 1 and
1 and p PROJ2 . PROJ1 contains only the information about
2 so that they partition EMP obeying the correctness rules of
project budgets, whereas PROJ2 contains project names and locations. It is important
fragmentation. To do this, modify the predicates, compose all minterm predicates and deduce the
to notice that the primary key to the relation (PNO) is included in both fragments. ⌥
corresponding implications, and then perform a horizontal fragmentation of EMP based on these
minterm predicates. Finally,
The fragmentation may, show that
of course, the result
be nested. has completeness,
If the nestings reconstruction and
are of different types,
disjointness properties.
one gets hybrid fragmentation. Even though we do not treat hybrid fragmentation as
a primitive fragmentation strategy, many real-life partitionings may be hybrid.
Problem#2
Consider relation ASG in Figure . Suppose there are two applications that access ASG. The first is issued at
five sites and attempts to find the duration of assignment of employees given their numbers. Assume that
3.2.3 Degree of Fragmentation
managers, consultants, engineers, and programmers are located at four different sites. The second
application is issued at two sites where the employees with an assignment duration of less than 20 months
The extent to which the database should be fragmented is an important decision
are managed at one site, whereas those with longer duration are managed at a second site. Derive the
that affects the performance of query execution. In fact, the issues in Section 3.2.1
primary horizontal fragmentation of ASG using the foregoing information.
concerning the reasons for fragmentation constitute a subset of the answers to the
question we are addressing here. The degree of fragmentation goes from one extreme,
Problem#3 that is, not to fragment at all, to the other extreme, to fragment to the level of
Consider relations EMP and PAY in Figure . EMP and PAY are horizontally fragmented as follows:

1. EMP1 = σTITLE=“Elect.Eng.”(EMP)
2. EMP2 = σTITLE=“Syst.Anal.”(EMP)
3. EMP3 = σTITLE=“Mech.Eng.”(EMP)
4. EMP4 = σTITLE=“Programmer”(EMP)

1. PAY1 = σSAL≥30000(PAY)
2. PAY2 = σSAL<30000(PAY)

Draw the join graph of EMP⋉TITLE PAY. Is the graph simple or partitioned? If it is partitioned, modify the
fragmentation of either EMP or PAY so that the join graph of EMP⋉TITLE PAY is simple.


Distributed Database Systems Assignment #2 Due Date: 17th May 11, 2019

Problem#4
Given relation PAY as in Figure, 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,
3.7 Bibliographic Notes 127
reconstruction, and disjointness of the fragmentation of EMP.
Problem 3.6 (**). Let Q = {q1 , . . . , q5 } be a set of queries, A = {A1 , . . . , A5 } be a
Problem#5
set of attributes, and S = {S1 , S2 , S3 } be a set of sites. The matrix of Figure 3.21a
describes the Let Q = {q 1,...,q
attribute usage 5} be a set of queries, A = {A
values 1,...,Agives
and the matrix of Figure 3.21b 5} be a set of attributes, and S = {S
the applica- 1,S2,S3} be a set of sites. The
matrix of Figure (a) describes the attribute usage values and the matrix of Figure (b) gives the application
tion access frequencies. Assume that re fi (qk ) = 1 for all qk and Si and that A1 is the
key attribute.access frequencies. Assume that ref
Use the bond energy and vertical partitioning algorithms to k obtain
i(qk) = 1 for all q and Sai and that A1 is the key attribute. Use the bond
vertical fragmentation of the set of attributes in A.
energy and vertical partitioning algorithms to obtain a vertical fragmentation of the set of attributes in A.

A1 A2 A3 A4 A5 S1 S2 S3

q1 0 1 1 0 1 q1 10 20 0

q2 1 1 1 0 1 q2 5 0 10

q3 1 0 0 1 1 q3 0 35 5

q4 0 0 1 0 0 q4 0 10 0

q5 1 1 1 0 0 q5 0 15 0

(a) (b)

Fig. 3.21 Attribute


Problem#6
Usage Values and Application Access Frequencies in Exercise 3.6
Assume the following view definition
CREATE VIEW AS
Problem 3.7 (**). EMPVIEW(ENO, ENAME, PNO, RESP)
Write an algorithm for derived horizontal fragmentation.
SELECT EMP.ENO, EMP.ENAME, ASG.PNO,
ASG.RESP
Problem 3.8 (**). Assume the following view definition
FROM EMP, ASG
CREATE VIEW
WHERE EMPVIEW(ENO, ENAME, PNO, RESP)
EMP.ENO=ASG.ENO
AS AND EMP.ENO, EMP.ENAME,
SELECT
DUR=24
ASG.PNO,

ASG.RESP
is accessed
FROM by application q1, located at sites 1 and 2, with frequencies 10 and 20, respectively. Let us
EMP, ASG
WHERE EMP.ENO=ASG.ENO
further assume that there is another query q2 defined as
AND DUR=24
SELECT ENO, DUR
is accessed byFROM ASG
application q1 , located at sites 1 and 2, with frequencies 10 and 20,
respectively. Let us further assume that there is another query q2 defined as
which is run at sites 2 and 3 with frequencies 20 and 10, respectively. Based on the above information,
SELECT ENO, DUR
FROM construct the use(q ,A ) matrix for the attributes of both relations EMP and ASG. Also construct the affinity
ASG
i j
which is run atmatrix containing all attributes of EMP and ASG. Finally, transform the affinity matrix so that it could be
sites 2 and 3 with frequencies 20 and 10, respectively. Based on the
used to split the relation into two vertical fragments using heuristics or BEA.
above information, construct the use(qi , A j ) matrix for the attributes of both relations
EMP and ASG. Also construct the affinity matrix containing all attributes of EMP
and ASG. Finally, transform the affinity matrix so that it could be used to split the
Problem#7
relation into two vertical fragments using heuristics or BEA.
Given a relation R(K,A,B,C) (where K is the key) and the following query
Problem 3.9 (**). Formally define the three correctness criteria for derived horizon-
SELECT *
tal fragmentation.
FROM R
WHERE R.A = 10 AND R.B=15

1. (a) What will be the outcome of running PHF on this query?


2. (b) Does the COM MIN algorithm produce in this case a complete and minimal predicate set?
Justify your answer.

Vous aimerez peut-être aussi