Chapter One1
Chapter One1
Optimizer
Query
Evaluation Engine Execution Plan
Output
Data
3
Three Steps of Query Processing
1) Parsing and translation: translate the query into relational
algebra
2) Optimization is to find the most efficient evaluation plan
for a query because there can be more than one way.
Optimization: Find the “cheapest" execution
usage.
Reduce the total execution time of the query,
10
Translating SQL Queries into Relational Algebra
Query block
P.PLOCATION=‘STAFFORD’;
14
Two query trees for Q2
15
Cost Estimates in Query Optimization
16
Cost Components for Query Execution
1. Access cost to secondary storage
2. Storage cost
3. Computation cost
4. Memory usage cost
5. Communication cost
17
Query Optimization in ORACLE
ORACLE DBMS provides two different approaches
21