Query Optimization is all about finding the query plan that minimizes the number of I/Os it takes to execute the query.
Introduction
We cannot know how many I/Os a plan will cost until it’s executed. So:
- Impossible to guarantee that we will find the optimal query plan. We can only hope to find a good one using heuristics and estimations
- We need some way to estimate how much a query plan costs. (That’s done in Plan Cost Estimator)