Download presentation
Presentation is loading. Please wait.
Published byCharity Hutchinson Modified over 9 years ago
1
Fan Qi fan.qi@nus.edu.sg Database Lab 1, com1 #01-08 CS3223 Tutorial 6
2
Join Aim: Computing Cartesian Product of two sets ( Table A Join Table B) Algorithms: Iteration-based Nested loop Block nested loop Index-based Index nested loop Partition-based Sort-merge join Hash join
3
Join The one with smaller size
4
Join — Index Nested Loop Join foreach tuple r in R do foreach tuple s in S do if r i == s j then add to result
5
Join – Sort Merge Join each S partition is scanned at most once during merging each tuple of R requires scanning entire S, can you construct a worse case?
6
Join – Grace Hash Join Memory InputOutput Probing Phase
7
Join – Hybrid Hash Join Memory Input Memory InputOutput Partition Phase of R Partition Phase of S
8
Join – Conditions Equality-Join, Natural-Join Index Nested Loop Join Sort-Merge Join Hash Join Nest Loop Join Inequality-join Nest Loop Join Index Nested Loop Join
9
Question 1 |S| < |R|, uniform distribution assumption
10
Question 1
13
Question 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.