Distributed Database Management Systems: Lecture 15. The main topics covered in this chapter include: PHF- Minimality of Pr; PHF-COM-MIN algorithm; primary horizontal partitioning algorithm; derived horizontal fragmentation (DHF);...
Trang 1Distributed Database Management Systems
Lecture 15
Trang 2Virtual University of Pakistan 2
PHF- Minimality of Pr
Trang 3Virtual University of Pakistan 3
• A relevant predicate is the one if it influences how fragmentation is
performed (fragments f into f i and f j ) then there should be at least one
application that accesses f i and f j
differently
Trang 4Virtual University of Pakistan 4
If all predicates in a set Pr are relevant then the set is minimal
Trang 5Virtual University of Pakistan 5
PHF-COM-MIN Algorithm
Trang 6Virtual University of Pakistan 6
• Given: a relation R and a set of
simple predicates P r
• Output: a complete and minimal set of
simple predicates P r ’ for P r
Trang 7Virtual University of Pakistan 7
• Rule 1: a relation or fragment is
partitioned into at least two parts
which are accessed differently by at least one application.
Trang 8Virtual University of Pakistan 8
1-Initialization:
– Find a p i ∈ ∈ Pr such that p Pr such that p i ,
partitions R according to Rule 1 Pr’ ← p i
Pr ← Pr – p i
Trang 9Virtual University of Pakistan 9
2- Iteratively add predicates to Pr' until it is complete, find a pj ∈ ∈ Pr such that pj
partitions R according to Rule 1
set Pr' = Pr' U pi ;
Pr = Pr – pi ;
Trang 10Virtual University of Pakistan 10
if p k in Pr' is non-relevant then
Pr' = Pr' – p k
Trang 11Virtual University of Pakistan 11
Primary Horizontal Partitioning
Algorithm
Trang 12Virtual University of Pakistan 12
fragmentation
predicates Pr
Trang 13Virtual University of Pakistan 13
predicates M according to which relation R is to be fragmented
Trang 14Virtual University of Pakistan 14
• Pr‘ ← COM_MIN (R,Pr)
predicates
Trang 15Virtual University of Pakistan 15
among pi Pr
minterms from M
Trang 16Virtual University of Pakistan 16
PHF – Example II
Trang 17Virtual University of Pakistan 17
1 Find the name and budget of projects given their no issued at three sites
– p1 : LOC = "Lahore”
– p2 : LOC = “Rawalpindi"
– p3 : LOC = "Peshawar“
Trang 18Virtual University of Pakistan 18
2 Access project information according to budge one site accesses ≤ 200000 other accesses >200000
– p4 : BUDGET ≤ 200000
– p5 : BUDGET > 200000
Trang 19Virtual University of Pakistan 19
Pr = Pr' = {p 1 ,p 2 ,p 3 ,p 4 ,p 5 }
• Implications
• p 1 p 2 p 3
• p 4 p 5
Trang 20Virtual University of Pakistan 20
• From predicates p1 to p6 in Pr’, there
may be so many minterm predicates, like,
p1 ^ p2 ^ p3 ^ p4 ^ p5
Excluding the contradicting minterm
predicates
Trang 21Virtual University of Pakistan 21
Trang 22Virtual University of Pakistan 22
• Implications must be based on the database semantics not on a
particular extension of the
database
Trang 23Virtual University of Pakistan 23
Trang 24Virtual University of Pakistan 24
Trang 25Virtual University of Pakistan 25
Derived Horizontal Fragmentation(DHF)
Trang 26Virtual University of Pakistan 26
• Defined on a member relation of a link according to a selection
operation specified on its owner
Trang 27Virtual University of Pakistan 27
• Two important points:
– Each link is an equi-join.
– Equijoin can be implemented by means
of semi-joins
Trang 28Virtual University of Pakistan 28
• So we are interested in defining the
partitions of member based on
fragmentation of its owner, but want to see attributes only from member, so
Trang 29Virtual University of Pakistan 29
R i = R ⋉ S i , 1≤ i ≤ w
where w is the maximum number of
fragments that will be defined on R and
Si = Fi (S), where Fi is formula for PHF on S
Trang 30Virtual University of Pakistan 30
DHF Example
Trang 31Virtual University of Pakistan 31
Trang 32Virtual University of Pakistan 32
EMP
salaries one with salary less than or equal to
30,000/- and other more than that
Trang 33Virtual University of Pakistan 33
Trang 34Virtual University of Pakistan 34
Trang 35Virtual University of Pakistan 35
Trang 36Thanks