Overview of the Optimizer
To understand how Oracle Database processes SQL statements, it is necessary to understand the part of the database called the optimizer (also known as the query optimizer or cost-based optimizer). All SQL statements use the optimizer to determine the most efficient means of accessing the specified data.
sap erp pp production planning training courses malaysia
Use of the Optimizer
The optimizer generates execution plans describing possible methods of execution.
The optimizer determines which execution plan is most efficient by considering several sources of information. For example, the optimizer considers query conditions, available access paths, statistics gathered for the system, and hints.
sap erp procurement material management training courses malaysia
To execute a DML statement, Oracle Database may have to perform many steps. Each step either retrieves rows of data physically from the database or prepares them for the user issuing the statement. The steps that the database uses to execute a statement greatly affect how quickly the statement runs. Many different ways of processing a DML statement are often possible. For example, the order in which tables or indexes are accessed can vary.
red hat openstack training courses malaysia
When determining the best execution plan for a SQL statement, the optimizer performs the following operations:
Evaluation of expressions and conditions
Inspection of integrity constraints to learn more about the data and optimize based on this metadata
Statement transformation
Choice of optimizer goals
Choice of access paths
Choice of join orders
The optimizer generates most of the possible ways of processing a query and assigns a cost to each step in the generated execution plan. The plan with the lowest cost is chosen as the query plan to be executed.
You can influence optimizer choices by setting the optimizer goal and by gathering representative statistics for the optimizer. For example, you may set the optimizer goal to either of the following:
Total throughput
The
ALL_ROWShint instructs the optimizer to get the last row of the result to the client application as fast as possible.Initial response time
The
FIRST_ROWShint instructs the optimizer to get the first row to the client as fast as possible.
A typical end-user, interactive application would benefit from initial response time optimization, whereas a batch-mode, non-interactive application would benefit from total throughput optimization.
Comments
Post a Comment