Distributed Database Management Systems: Lecture 19. The main topics covered in this chapter include: continue with VF to example of VF; partitioning in CA; allocation problem; compute the contribution by placing 3rd attribute at different places in CA;...
Distributed Database Management Systems Lecture 19 In the Previous Lecture • Continued with VF –Global Affinity Measure –Bond Energy Algorithm In this Lecture • Continue with VF –Example of VF –Partitioning in CA –Allocation Problem A1 A1 45 A2 A2 A3 45 A4 80 A3 45 53 A4 75 75 78 A1 A2 A1 45 A2 80 A3 A4 45 75 Compute the contribution by placing 3rd attribute at different places in CA • Ordering (0-3-1) – means A3 on left of A1 • Ordering (1-3-2) – means A3 in between A1 and A2 • Ordering (2-3-4) – means A3 on right of A4 cont (A0, A3, A1) = 2 bond(A0, A3) + 2 bond(A3, A1) – 2bond(A0, A1) bond(A0, A3) = 0 and (A0, A1) = 0 because A0 refers to the left of leftmost attribute bond(A3, A1) = ∑z = 1aff(Az, A3)aff(Az, A1) = aff(A1, A3)aff(A1, A1) + aff(A2, A3) aff(A2, A1) + aff(A3, A3)aff(A3, A1) + aff(A4, A3)aff(A4, A1) = 45 * 45 + 5 * 0 + 53 * 45 + 3 * 0 = 4410 • Thus cont(A0, A3, A1) = bond(A0, A3) + bond(A3, A1) 2bond(A0, A1) = * + * 4410 – * = 8820 Ordering (1-3-2) cont (A1, A3, A2) = 2 bond(A1, A3) + 2 bond(A3, A2) 2bond(A1, A2) bond(A1, A3) = bond(A3, A1) = 4410 bond(A3, A2) =0+400+265+225= 890 bond(A1, A2) =0+0+45*5= 225 cont(A1, A3, A2) = 2*4410+2*890–2*225 = 8820 + 1780 – 450 = 10150 Ordering (234) cont (A2, A3, A4) = 2 bond(A2, A3) + 2 bond(A3, A4) 2bond(A2, A4) bond(A2, A3) = 890 bond(A3, A4) = 0 bond(A2, A4) = 0 cont (A2, A3, A4) = 2 * 890 + 0 + 0 = 1780 • We need to work out –Ordering (0-4-1) –Ordering (1-4-3) –Ordering (3-4-2) –Ordering (2-4-5) • We need to work out –Ordering (0-4-1) –Ordering (1-4-3) –Ordering (3-4-2) –Ordering (2-4-5) A1 A2 A3 A4 A1 45 A3 45 45 53 A2 A4 80 75 75 78 •Columns order changed •Rows still in same order •We switch the order of the rows accordingly •BEA results following CA •Note the clusters A1 A3 A2 A4 A1 A3 A2 45 45 45 53 5 80 A4 75 75 78 Clustering Summary • We need AUM that reflects the QueryAttribute relationship • AUM and FM are used to make AA • Global Affinity Measure is used to establish the clusters of attributes • Stronger affinities attributes and weaker ones are grouped in CA Partitioning The objective is to establish attributes that are generally accessed together TA TB Define • TQ = set of applications that access only TA • BQ = set of applications that access only BA • OQ = set of applications that access both TA and BA • CTQ = number of accesses to attributes by applications that access only TA • CBQ = number of accesses to attributes by applications that access only BA • COQ = number of accesses to attributes by applications that access both TA and BA • Then find the point z along the diagonal that maximizes z = CTQ * CBQ - COQ A1 A3 A2 A4 A1 45 45 0 A3 45 53 A2 A4 75 78 CA 80 75 A1 A2 A3 A4 S1 S2 S3 q1 1 q1 15 20 10 q2 1 q2 q3 1 q3 25 25 25 q4 0 1 refj(qi) 0 q4 0 accj(qi) TQ = {q1) CTQ = 15 * 1 + 20 *1 + 10 * 1 = 45 BQ = {q3} CBQ = 25 * 1 + 25 * 1 + 25 * 1 = 75 OQ = {q2, q4} COQ = 5 * 1 + 0 + 0 + 3 * 1 + 0 + 0 = 8 z = CTQ * CBQ – COQ2 = 45 * 75 – 82 = 3375 – 64 = 3311 A1 A3 A2 A4 A1 45 45 0 A3 45 53 A2 A4 75 78 CA 80 75 A1 A2 A3 A4 S1 S2 S3 q1 1 q1 15 20 10 q2 1 q2 q3 1 q3 25 25 25 q4 0 1 refj(qi) z2 = 3311 z1 = 0 – 452 z3= 0 78 0 q4 0 accj(qi) Thanks ...In the Previous Lecture • Continued with VF –Global Affinity Measure –Bond Energy Algorithm In this Lecture • Continue with VF –Example of VF –Partitioning