Joining ¡Tables ¡
CompSci ¡590.04 ¡ Instructor: ¡Ashwin ¡Machanavajjhala ¡ ¡
1 ¡ Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡
A SQL Query walks into a bar. In the corner of the - - PowerPoint PPT Presentation
Joining Tables CompSci 590.04 Instructor: Ashwin Machanavajjhala Lecture 18 : 590.04 Fall 15 1 A SQL Query walks into a bar. In the corner of
1 ¡ Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡
2 ¡
Image ¡credit: ¡http://www.swcasinoproductions.com/images/party-rentals/lighted-tables-buffets-furniture/party-rentals-lighted-bar-acrylic.jpg
– Social ¡network: ¡Table ¡of ¡edges ¡and ¡Table ¡of ¡verEces ¡
– How ¡many ¡triangles ¡are ¡there ¡in ¡a ¡graph ¡
– Need ¡to ¡join ¡a ¡table ¡of ¡income ¡and ¡table ¡of ¡educaEon ¡to ¡get ¡correlaEon ¡ between ¡the ¡two ¡aQributes. ¡ ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 3 ¡
– R ¡is ¡a ¡table ¡with ¡two ¡aQributes ¡A ¡and ¡B ¡ – S ¡is ¡a ¡table ¡with ¡two ¡aQributes ¡B ¡and ¡C ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 4 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 5 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 6 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 7 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 8 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 9 ¡
Mij$is$shaded$if$corresponding$tuples$appear$in$the$join$output.$$ Goal:$find$a$mapping$between$join$matrix$cells$to$reducers$that$$ Goal:$find$a$mapping$between$join$matrix$cells$to$reducers$that$$ $$$$$$$$$$$minimizes$compleQon$Qme.$$
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 10 ¡
Lecture$12$:$590.02$Spring$13$
– Divide ¡the ¡cells ¡in ¡the ¡join ¡matrix ¡equally ¡ amongst ¡reducers ¡
– Higher ¡communicaEon ¡cost ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 11 ¡
Lecture$12$:$590.02$Spring$13
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 12 ¡
Lecture$12$:$590.02$Spring$13$
– Sufficient ¡to ¡idenEfy ¡a ¡superset ¡of ¡the ¡shaded ¡cells ¡in ¡the ¡join ¡matrix ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 13 ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 14 ¡
– For ¡efficiency ¡reasons. ¡ ¡
Lecture ¡18 ¡: ¡590.04 ¡Fall ¡15 ¡ 15 ¡
R1 R2 R4 R3 R1 R4 R2 Left-deep plan Bushy plan