Page 223 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 223
Database Management Systems/Managing Database
Notes 12.9 Choice of Evaluation Plan
Let us first define the term Evaluation Plan.
An evaluation plan defines exactly which algorithm is to be used for each operation, and how
the execution of the operation is coordinated. For example, Figure 12.10 shows the query tree
with evaluation plan.
Figure 12.10: Query Evaluation Plan
Choice of Evaluation Plans
For choosing an evaluation technique, we must consider the interaction of evaluation techniques.
Please note that choosing the cheapest algorithm for each operation independently may not
yield best overall algorithm. For example, merge-join may be costlier than hash-join, but may
provide a sorted output which reduces the cost for a higher level aggregation. A nested-loop
join may provide opportunity for pipelining. Practical query optimisers incorporate elements
of the following two broad approaches:
1. Searches all the plans and chooses the best plan in a cost-based fashion.
2. Uses heuristic rules to choose a plan.
12.10 Summary
In this unit, you have study query processing and evaluation.
A query in a DBMS is a very important operation, as it needs to be efficient.
Query processing involves query parsing, representing query in alternative forms, finding
the best plan of evaluation of a query and then actually evaluating it.
The major query evaluation cost is the disk access time.
In this unit, we have discussed the cost of different operations in details.
However, an overall query cost will not be a simple addition of all such costs.
216 LOVELY PROFESSIONAL UNIVERSITY