Estimating the cost of a logical query plan
Recall:
The best join ordering (= query plan)
is the one that has the least # tuples
in
all the result sets:
Estimating the cost of a logical query plan
- Example
Samples of
query plans
with different join ordering:
Estimating the cost of a logical query plan
- Example
Samples of
query plans
with different join ordering:
Every query plan will
read the
same input relations !!!
Estimating the cost of a logical query plan
- Example
Operators that are
above the last join operator
are the
same in
all query plans:
X2 = Y2 = Z2 = C2 and
X3 = Y3 = Z3 = C3 and
X4 = Y4 = Z4 = C4 !
Estimating the cost of a logical query plan
- Conclusion
The cost difference between
different
logical query plans
differs
only
in the size of
the
intermediate result set(s)
of the join operations:
❮
❯