Rowley4
asked on
Estimating size of tuples
If I have to estimate a size of tuples. Would I multiply them together? I am unsure how to approach this as I believe I would multiply them up. What strategy would you take with this? Thanks!
R1 has 1000, r2 has 1500, and r3 has 750
R1 has 1000, r2 has 1500, and r3 has 750
can you please explain what you are trying to do
ASKER
Say r1 (ABC, r2 (CDE) and r3 (EF) with primary keys A C and E. I wanted to estimate the sizes of these tuples if r1 has 1000 r2 has 1500 and r3 has 750?
can ask more :) until somebody else answer your question
what is R1, R2, R3
are those tables? ABC, CDE, EF are columns? A C E are PK on each table?
R1 has 1000 means it has 1000 records (1000 unique A value)?
by tuple what do you mean, can you give samples...
what is R1, R2, R3
are those tables? ABC, CDE, EF are columns? A C E are PK on each table?
R1 has 1000 means it has 1000 records (1000 unique A value)?
by tuple what do you mean, can you give samples...
ASKER
Yes, you are exactly correct on all your assumptions.
Suppose we have
R(a,b) with T(R) = 1000 and V(R,b) = 20
S(b,c) with T(S) = 2000, V(S,b) = 50, and V(S,c) = 100
U(c,d) with T(U) = 5000 and V(U,c) = 500
What is the estimated size of R S U?
First join R and S (on attribute b):
estimated size of result, X, is T(R)*T(S)/max(V(R,b),V(S,b )) = 40,000
by containment of value sets, number of values of c in X is the same as in S, namely 100
Then join X with U (on attribute c):
estimated size of result is T(X)*T(U)/max(V(X,c),V(U,c )) = 400,000
Suppose we have
R(a,b) with T(R) = 1000 and V(R,b) = 20
S(b,c) with T(S) = 2000, V(S,b) = 50, and V(S,c) = 100
U(c,d) with T(U) = 5000 and V(U,c) = 500
What is the estimated size of R S U?
First join R and S (on attribute b):
estimated size of result, X, is T(R)*T(S)/max(V(R,b),V(S,b
by containment of value sets, number of values of c in X is the same as in S, namely 100
Then join X with U (on attribute c):
estimated size of result is T(X)*T(U)/max(V(X,c),V(U,c
I am totally lost :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.