Say you have two relations R and S , where R has 1000 tuples and 100 page-accesses, and S has 50 tuples and 25 page-accesses.
Assuming R is the outer relation, then how many tuple-comparisons and page-accesses are done?
And how many page-accesses if R is the inner relation?
for each tuple r in R do for each tuple s in S do if r and s satisfy the join condition then output the tuple (r,s)
So in order to find out how many tuple-comparisons are done, I need to do 1000 * 50 = 50000 because the algorithm is doing this "for each" tuple and we have in total 1000 tuples for R and 50 tuples for S, thus 50000 comparisons in total.
But how to know the page-accesses now? If R is outside, we have (1000 tuples) * (25 page-accesses for S) + (100 page-accesses for R) = 25100 page accesses?
And if R is inside, then: 50 * 100 + 25 = 5025 page accesses
I'm not sure if it is correct like that.. or how is this done correctly pleaseee? :/