Finding the best query plan -
how to compare
different query plans
Pre-requisite to
any optimization problem:
We say that
a query plan (relational algebra expression) A
is
better than
another
query plan (relational algebra expression) B
if:
Question:
what cost measure should we use ?
How to measure the cost of
a logical query plan
Comment:
Example to illustrate the cost of
a (logical) query plan
Question:
which query plan has
the smallest # disk IOs ?
Example to illustrate the cost of
a (logical) query plan
Question:
which query plan has
the smallest # disk IOs ?
Problem that we need to solve to perform query optimization
Pre-requisite to query optimization:
cost estimation !!!
❮
❯