Databases Reference
In-Depth Information
In step 5, we retrieve the
SQL_ID
of the query executed in the preceding step and create a SQL
Baseline using the procedure
LOAD_PLANS_FROM_CURSOR_CACHE
of the package
DBMS_SPM
,
using
SQL_ID
. We can see the results of this operation in the following screenshot:
In step 6, we create an index over the
CUST_VALID
field, so accessing the
MY_CUSTOMERS
table using this index may be faster than a full table scan.
In step 7, we execute the same query as in step 4. The optimizer uses the execution plan
stored in the SQL Baseline but elaborates a new execution plan and stores it in a NOT
ACCEPTED state, as we can see when executing the query in step 8.
In step 9, we decide to evolve our SQL Baseline, executing the procedure
EVOLVE_SQL_
PLAN_BASELINE
of the
DBMS_SPM
package, as we can see in the following screenshot: