Overview of Query Optimization in Oracle
Overview of Query Optimization in Oracle
Cost-Based Optimization
Query optimization is the overall process of choosing the most
efficient means of executing a SQL statement.
SQL is a nonprocedural language, so the optimizer is free to merge,
reorganize, and process in any order.
The database optimizes each SQL statement based on statistics
collected about the accessed data.
The optimizer determines the optimal plan for a SQL statement by
examining multiple access methods, such as full table scan or index
scans, different join methods such as nested loops and hash joins,
different join orders, and possible transformations.
Execution Plans
An execution plan describes a recommended method of execution
for a SQL statement.
The plan shows the combination of the steps Oracle Database uses
to execute a SQL statement.
Each step either retrieves rows of data physically from the database
or prepares them for the user issuing the statement.
SELECT first_name, last_name
FROM hr.employees
WHERE department_id
IN (SELECT department_id
FROM hr.departments
or
"I need the most efficient route from point A to point B by way of point
C."
Or
Query Transformer
Estimator
Plan Generator