- Case 1: b = 0
There are 150 tuples in R with R.b = 0
There are 100 tuples in S with S.b = 0
===> R(a,0) ⋈ S(0,c) ==> 15,000 tuples
|
- Case 2: b = 1
There are 200 tuples in R with R.b = 1
There are 80 tuples in S with S.b = 1
===> R(a,1) ⋈ S(1,c) ==> 16,000 tuples
|
- Case 3: b = 5
There are 100 tuples in R with R.b = 1
There are 250 tuples in S with 10 other values
==> assume that b=5 is one of the other values
==> Then: avg # tuples in S with "S.b = 5" = 25
===> R(a,5) ⋈ S(5,c) ==> 2,500 tuples
|
- Case 4: b = 2
There are 70 tuples in S with S.b = 2
There are 550 tuples in R with 11 other values
==> assume that b=2 is one of the other values
==> Then: avg # tuples in R with "R.b = 2" = 50
===> R(a,2) ⋈ S(2,c) ==> 3,500 tuples
|
- Case 5: b = "other"
There are 550 tuples in R with 11 other values
R.b = { 0, 1, 5, x, x, x, .... (11 other values) } // V(R,b) = 14
==> Then: avg 50 tuples in R per value
There are 250 tuples in S with 10 other values
S.b = { 0, 1, 2, y, y, y, .... (10 other values) } // V(S,b) = 13
==> Then: avg 25 tuples in S per value
We continue to make the containment of value set assumption:
V(S,b) ≤ V(R,b) ===> all values of S.b are in R.b
Since: we have assumed that 5 ∈ R.b, we have:
S.b = { 0, 1, 2, 5, y, y, y, .... (9 other values !!) }
Each of these 9 other values will join in R⋈S !!!
Therefore:
===> R(a,other) ⋈ S(other,c) ==> 9 × 50 × 25 tuples
|
- Therefore:
T(R⋈S) ~= 15,000 + 16,000 + 2,500 + 3,500 + 9×50×25
~= 48,250 tuples
|
|