3. Introduction
• Query:
A query is a request for information from a
database.
• Query Processing:
It is a translation of high-level queries into low
level expressions . It is a step wise process that
can be used at the physical level of the file
system.
4. Cont..
Query Optimization:
It is a process in which multiple query-execution
plans for satisfying a query are examined and
the most efficient query plan is identified
GOAL:
The goal of query optimization is to reduce the
system resources required to fulfill a query, and
ultimately provide the user with the correct
result set faster.
5. Query Block
• It is the basic unit of SQL that operates on tables
on the results of other queries by performing
join, grouping, projection, or selection
operations.
• The result of a query block is a table that is
known as a derived table.
6. Optimization Criteria
• Reduce total execution time of the query:
• Minimize the sum of the execution times of all
individual operations
• Reduce the number of disk access
• Reduce response time of the query:
• Maximize parallel operations.
7. Query Optimization Issues
• Query Rewriting:
• Transformation from one SQL query to another
one using semantic properties.
• Selecting query execution plan:
• Done on single query block.
• Cost estimation:
• To compare between plans we need to estimate
their cost using statistics on database.
8. Advantages
1. Faster processing of query
2. Lesser cost per query
3. High performance of the system
4. Lesser stress on database
5. Efficient usage of database engine
6. Lesser memory is consumed