The Query Advisor uses a set of rules and best-practices
to find structures in a query that are likely to cause the optimizer
to choose a suboptimal access path. You can rewrite the query to resolve
the problems that are identified in the recommendations.
About this task
The Query Advisor looks for opportunities in a query to
make the following improvements:
- Minimize the number of index pages and data rows that have to
be read. For example, you can minimize the number of rows read by
having predicates in the query that can determine the needed rows
from just the index alone.
- Minimize sort operations. For example, the advisor determines
whether ORDER BY or GROUP BY clauses are needed in the query, or if
sort operations can be resolved via index access.
After the Query Advisor generates recommendations for revising
an SQL statement for better performance, you can review the recommendations,
read explanations for the recommendations, and see examples of the
recommendations put into practice.