









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










s1 ∗ s2 / n r ∗ n r 1 ∨ 2 1 − 1 − s1 / n r ∗ 1 − s2 / n r ¬
θ 1 θ 2
1 ∧ 2
cost: b(r) + b(r)*b(s) assuming that b(s) > M
cost = [ (M + b(s)]* b(r)/M = b(r)+[b(r)*b(s)]/M
Buffer size M+
cost = b r ( 2 log M – ( b r / M) + 1) + b r
i
i
r
s
i
The hash-join of r and s is computed as follows. Relation s is called the build input and r is called the probe input.
depositor
customer
customer depositor
for each block b(r) in r do begin for each tuple t(r) in b(r) do begin search the index B on s with the value t.A of the joining attr. A and join(t(r),t.A) end end
●external vs internal sorting: relation/file does not fit in memory ●create runs phase: ●merge-runs phase: ● ● (^) this assumes that a block from each run can be kept in main memory. If not, then the same algorithm has to be applied in multiple passes repeat until done read M blocks of the relation (or rest if <=M) internal sort using any sort method, e.g QuickSort(M) write the sorted tuples into a run R data file end read one block from each run; merge tuples on the result; advance the pointer from the run you appended last; if the block of a run is empty, read the next one until all blocks of all runs are done