







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Prof. Jitesh Bhaskar delivered this lecture for Distributed and Parallel Data Management course at Dhirubhai Ambani Institute of Information and Communication Technology. Its main point are: Distributed, Database, Design, Fragmentation, Allocation, Queries, Round, Hash, Range, Partitioning
Typology: Slides
1 / 13
This page cannot be seen from the preview
Don't miss anything!








CS 347 Notes 02 7
E (^5) 7 8
Sa 10 Sally Sb 25 Tom Sa 15
Joe
5 8
Sa 10 Tom Sa 15
Joe 7 Sally Sb 25
At Sa At Sb CS 347 Notes 02 8
F 1 = loc=Sa E F 2 = loc=Sb E
CS 347 Notes 02 9
F 1 = loc=Sa E F 2 = loc=Sb E
called primary horizontal fragmentation
CS 347 Notes 02 10
CS 347 Notes 02 11
CS 347 Notes 02 12
CS 347 Notes 02 13
R D 0 D 1 D 2 t1 t t2 t t3 t t4 t ... t
R D 0 D 1 D 2 t1h(k 1 )=2 t t2h(k 2 )=0 t t3h(k 3 )=0 t t4h(k 4 )=1 t ...
CS 347 Notes 02 15
R D 0 D 1 D 2 t1: A=5 t t2: A=8 t t3: A=2 t t4: A=3 t ...
partitioning vector
V 0 V 1
CS 347 Notes 02 16
Example:
F 1 = sal<10 E F 2 = sal>20 E
CS 347 Notes 02 17
Example:
F 1 = sal<10 E F 2 = sal>20 E
Problem: Some tuples lost!
CS 347 Notes 02 18
Second example:
F 3 = sal<10 E F 4 = sal>5 E
CS 347 Notes 02 25
CS 347 Notes 02 26
(1) A<10 A>5 Loc=SA Loc=SB (2) A<10 A>5 Loc=SA ¬(Loc=SB ) (3) A<10 A>5 ¬(Loc=SA ) Loc=SB (4) A<10 A>5 ¬(Loc=SA ) ¬(Loc=SB ) (5) A<10 ¬(A>5) Loc=SA Loc=SB (6) A<10 ¬(A>5) Loc=SA ¬(Loc=SB ) (7) A<10 ¬(A>5) ¬(Loc=SA ) Loc=SB (8) A<10 ¬(A>5) ¬(Loc=SA ) ¬(Loc=SB )
CS 347 Notes 02 27
(1) A<10 A>5 Loc=SA Loc=SB (2) A<10 A>5 Loc=SA ¬(Loc=SB ) (3) A<10 A>5 ¬(Loc=SA ) Loc=SB (4) A<10 A>5 ¬(Loc=SA ) ¬(Loc=SB ) (5) A<10 ¬(A>5) Loc=SA Loc=SB (6) A<10 ¬(A>5) Loc=SA ¬(Loc=SB ) (7) A<10 ¬(A>5) ¬(Loc=SA ) Loc=SB (8) A<10 ¬(A>5) ¬(Loc=SA ) ¬(Loc=SB )
CS 347 Notes 02 28
(1) A<10 A>5 Loc=SA Loc=SB (2) A<10 A>5 Loc=SA ¬(Loc=SB ) (3) A<10 A>5 ¬(Loc=SA ) Loc=SB (4) A<10 A>5 ¬(Loc=SA ) ¬(Loc=SB ) (5) A<10 ¬(A>5) Loc=SA Loc=SB (6) A<10 ¬(A>5) Loc=SA ¬(Loc=SB ) (7) A<10 ¬(A>5) ¬(Loc=SA ) Loc=SB (8) A<10 ¬(A>5) ¬(Loc=SA ) ¬(Loc=SB )
A 5
CS 347 Notes 02 29
(9) ¬(A<10) A>5 Loc=SA Loc=SB (10) ¬(A<10) A>5 Loc=SA ¬(Loc=SB ) (11) ¬(A<10) A>5 ¬(Loc=SA ) Loc=SB (12) ¬(A<10) A>5 ¬(Loc=SA ) ¬(Loc=SB ) (13) ¬(A<10) ¬(A>5) Loc=SA Loc=SB (14) ¬(A<10) ¬(A>5) Loc=SA ¬(Loc=SB ) (15) ¬(A<10) ¬(A>5) ¬(Loc=SA ) Loc=SB (16) ¬(A<10) ¬(A>5) ¬(Loc=SA ) ¬(Loc=SB )
CS 347 Notes 02 30
(9) ¬(A<10) A>5 Loc=SA Loc=SB (10) ¬(A<10) A>5 Loc=SA ¬(Loc=SB ) (11) ¬(A<10) A>5 ¬(Loc=SA ) Loc=SB (12) ¬(A<10) A>5 ¬(Loc=SA ) ¬(Loc=SB ) (13) ¬(A<10) ¬(A>5) Loc=SA Loc=SB (14) ¬(A<10) ¬(A>5) Loc=SA ¬(Loc=SB ) (15) ¬(A<10) ¬(A>5) ¬(Loc=SA ) Loc=SB (16) ¬(A<10) ¬(A>5) ¬(Loc=SA ) ¬(Loc=SB ) A 10
CS 347 Notes 02 31
F 2: 5 < A < 10 Loc=SA F 3: 5 < A < 10 Loc=SB F 6: A 5 Loc=SA F 7: A 5 Loc=SB F 10: A 10 Loc=SA F 11: A 10 Loc=SB
CS 347 Notes 02 32
e.g.: if LOC could be SA , SB , we need to add fragments F 4: 5
CS 347 Notes 02 43
(at Sa) (^) (at Sb )
5 Joe Sa 10 8 Tom Sa 15 …
7 Sally Sb 25 12 Fred Sb 15 …
5 work on 347 hw 7 go to moon 5 build table 12 rest …
CS 347 Notes 02 44
(at Sa) (^) (at Sb )
5 Joe Sa 10 8 Tom Sa 15 …
7 Sally Sb 25 12 Fred Sb 15 …
5 work on 347 hw 5 build table …
7 go to moon 12 rest …
CS 347 Notes 02 45
Convention: R is owner S is member
F could be primary or derived
CS 347 Notes 02 46
But no #= 33 in E 1 nor in E 2!
… 33 build chair …
Example: Say J is:
This J tuple will not be in J 1 nor J 2 Fragmentation not complete
CS 347 Notes 02 47
Need to enforce referential integrity constraint: join attr(#) of member relation joint attr(#) of owner relation
To get completeness
CS 347 Notes 02 48
5 Joe Sa 10 …
5 Fred Sb 20 …
Example:
E 1 E^2
5 day off …
5 day off …
5 day off …
Fragmentation is not disjoint!
CS 347 Notes 02 49
Join attribute(#) should be key of owner relation
To get disjointness
CS 347 Notes 02 50
CS 347 Notes 02 51
5 Joe Sa 10 7 Sally Sb 25 8 Fred Sa 15 …
5 Joe Sa 7 Sally Sb 8 Fred Sa …
5 10 7 25 8 15 …
Example:
CS 347 Notes 02 52
R[T] R 1 [T 1 ] T i T
R n [Tn]
Just like normalization of relations
CS 347 Notes 02 53
(1) Completeness
U Ti = T all i
CS 347 Notes 02 54
(2) Disjointness Ti Tj = for all i,j ij
CS 347 Notes 02 61
Example: E(#,NM,LOC,SAL) F 1 = loc=Sa E ; F 2 = loc=Sb E Qa: select … where loc=Sa... Qb: select … where loc=Sb…
Site a Site b
Where do F 1 ,F 2 go?
? CS 347 Notes 02 62
CS 347 Notes 02 63
CS 347 Notes 02 64
CS 347 Notes 02 65
This is an incredibly hard problem
CS 347 Notes 02 67
Read cost: [t i MIN Cij ]
i: Originating site of request t i: Read traffic at Si Cij : Retrieval cost Accessing fragment F at Sj from Si
i=1 j
m
CS 347 Notes 02 68
.
..
.
.
.
i C=inf
c i,
c i,1 (^) c i,
Stream of read requests for F ti REQ/SEC C=inf
C=inf F
F F
CS 347 Notes 02 69
Xj ui C’ ij
i: Originating site of request j: Site being updated Xj : 0 if F not stored at Sj 1 if F stored at Sj ui: Write traffic at Si C’ ij : Write cost Updating F at Sj from Si
i=1 j=
m m
CS 347 Notes 02 70
Updates ui updates/sec
.. .. .. i
F
F F
CS 347 Notes 02 71
Xi d i
Xi: 0 if F not stored at Si 1 if F stored at Si d i: storage cost at Si
i=
m
CS 347 Notes 02 72
min [t i MIN Cij + Xj ui C’ ij ]
i=1 j j=
i=
m m
m
CS 347 Notes 02 79 CS 347 Notes 02 80