Query Optimization
Purchase
Person
Buyer=name
City=‘seattle’
phone>’5430000’
buyer
(Simple Nested Loops)
Imperative query execution plan:
SELECT S.sname
FROM Purchase P, Person Q
WHERE P.buyer=Q.name AND
Q.city=‘seattle’ AND
Q.phone > ‘5430000’
Declarative SQL query
Plan: Tree of R.A. ops, with choice of alg for each op.
Ideally: Want to find best plan. Practically: Avoid worst plans!
Goal:
?
Previous slide
Next slide
Back to first slide
View graphic version