W(a,b) |
X(b,c) |
Y(c,d) |
Z(d,e) |
T(W) = 100 |
T(X) = 200 |
T(Y) = 300 |
T(Z) = 400 |
V(W,a) = 20 |
V(X,b) = 50 | V(Y,c) = 50 | V(Z,d) = 40 |
V(W,b) = 60 | V(X,c) = 100 | V(Y,d) = 50 | V(Z,e) = 100 |
16.6.3: Greedy algorithm for the join order of:
R(a,b) |
S(b,c) |
T(c,d) |
U(a,d) |
T(R) = 1000 |
T(S) = 100 |
T(T) = 200 |
T(U) = 1000 |
V(R,a) = 100 |
V(S,b) = 100 | V(T,c) = 10 | V(U,a) = 100 |
V(R,b) = 100 | V(S,c) = 10 | V(T,d) = 150 | V(U,d) = 100 |
16.7.1 Relation R(a,b,c,d) has a clustering indes on a and
non-clustering indexes on each of the other attributes (this means that
it is stored ordered by a).
Parameters are: B(R) = 1000, T(R) = 5000,
V(R,a) = 20, V(R,b) = 1000,
V(R,c) = 5000, & V(R,d) = 500.
Give the best query plan: (index scan or table-scan followed by a
filter step) and the disk-I/O cost for:
(b) Selection on R where a=1 AND b=2 AND c >= 3
(c) Selection on R where a=1 AND b<=2 AND c >= 3