Distributed Database
Management Systems
Lecture 15
PHF- Minimality of Pr
Virtual University of Pakistan
2
• A relevant predicate is the one if it
influences how fragmentation is
performed (fragments f into fi and fj)
then there should be at least one
application that accesses fi and fj
differently.
Virtual University of Pakistan
3
If all predicates in a set Pr are
relevant then the set is minimal
Virtual University of Pakistan
4
PHF-COM-MIN Algorithm
Virtual University of Pakistan
5
• Given: a relation R and a set of
simple predicates Pr.
• Output: a complete and minimal set of
simple predicates Pr’ for Pr.
Virtual University of Pakistan
6
• Rule 1: a relation or fragment is
partitioned into at least two parts
which are accessed differently by at
least one application.
Virtual University of Pakistan
7
1-Initialization:
–Find a pi ∈ Pr such that pi,
partitions R according to Rule 1
Pr’ ← pi
Pr ← Pr – pi
Virtual University of Pakistan
8
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 ;
Virtual University of Pakistan
9
if pk in Pr' is non-relevant then
Pr' = Pr' – pk
Virtual University of Pakistan
10
Primary Horizontal Partitioning
Algorithm
Virtual University of Pakistan
11
• Makes use of COM_MIN to perform
fragmentation
• Input: a relation R and a set of simple
predicates Pr
Virtual University of Pakistan
12
• Output: a set of minterm
predicates M according to which
relation R is to be fragmented
Virtual University of Pakistan
13
• Pr‘ ← COM_MIN (R,Pr)
• determine the set M of minterm
predicates
Virtual University of Pakistan
14
• determine the set I of implications
among pi Pr
• eliminate the contradictory
minterms from M
Virtual University of Pakistan
15
PHF – Example II
Virtual University of Pakistan
16
1 Find the name and budget of projects
given their no. issued at three sites
– p1 : LOC = "Lahore”
– p2 : LOC = “Rawalpindi"
– p3 : LOC = "Peshawar“
Virtual University of Pakistan
17
2 Access project information according to
budge one site accesses ≤ 200000 other
accesses >200000
– p4 : BUDGET ≤ 200000
– p5 : BUDGET > 200000
Virtual University of Pakistan
18
Pr = Pr' = {p1 ,p2 ,p3 ,p4 ,p5 }
• Implications
p2 p3
• p1
• p4
p5
Virtual University of Pakistan
19
• 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
Virtual University of Pakistan
20
–m1 : (LOC = "Lahore") ^ (BUDGET ≤ 2M)
–m2 : (LOC = "Lahore") ^ (BUDGET > 2M)
–m3 : (LOC = " Rawalpindi ") ^ (BUDGET ≤ 2M)
–m4 : (LOC = "Rawalpindi") ^ (BUDGET > 2M)
–m5 : (LOC = "Peshawar") ^ (BUDGET ≤ 2M)
–m6 : (LOC = "Peshawar") ^ (BUDGET > 2M)
Virtual University of Pakistan
21
• Implications must be based on the
database semantics not on a
particular extension of the
database
Virtual University of Pakistan
22
PROJ
pNo
pName
budget
Loc
P1
Instrumentation
3.5M
Lahore
P2
Database Dev.
2.3M
Rawalpindi
P3
CAD/CAM
1.9M
Rawalpindi
P4
Maintenance
1.6M
Peshawar
Virtual University of Pakistan
23
pNo
pName
budget
Loc
P1
Instrumentation
3.5M
Lahore
P2
Database Dev.
2.3M
Rawalpindi
P3
CAD/CAM
1.9M
Rawalpindi
P4
Maintenance
1.6M
Peshawar
Virtual University of Pakistan
24
Derived Horizontal
Fragmentation(DHF)
Virtual University of Pakistan
25