set autotrace off SQL> Select sql_text, executions, plan_hash_value SQL> From dba_sqlset_statements SQL> Where sql_text like 'select /* testsql */%' SQL> and sqlset_name = 'SYS_AUTO_STS'; SQL_TEXT EXECUTIONS PLAN_HASH_VALUE ------------------------------------------------------------------------------ ---------- --------------- select /* testsql */ /*+ NO_RESULT_CACHE */ p.product_name, p.supplier_id, 1 4007241392 sum(o.quantity), count(*) from order_items o, product_information p where o.product_id = p.product_id and p.product_id = 1 group by p.product_name, p.supplier_id;
set autotrace traceonly SQL> Select /* testsql */ /*+ NO_RESULT_CACHE */ p.product_name, p.supplier_id, sum(o.quantity), count(*) SQL> From order_items o, product_information p SQL> Where o.product_id = p.product_id and p.product_id = 1 SQL> Group By p.product_name, p.supplier_id;
set autotrace off SQL> Select sql_text, executions, plan_hash_value SQL> From dba_sqlset_statements SQL> Where sql_text like 'select /* testsql */%' SQL> and sqlset_name = 'SYS_AUTO_STS'; SQL_TEXT EXECUTIONS PLAN_HASH_VALUE ------------------------------------------------------------------------------ ---------- --------------- select /* testsql */ /*+ NO_RESULT_CACHE */ p.product_name, p.supplier_id, 1 4007241392 sum(o.quantity), count(*) from order_items o, product_information p where o.product_id = p.product_id and p.product_id = 1 group by p.product_name, p.supplier_id; select /* testsql */ /*+ NO_RESULT_CACHE */ p.product_name, p.supplier_id, 1 2559952882 sum(o.quantity), count(*) from order_items o, product_information p where o.product_id = p.product_id and p.product_id = 1 group by p.product_name, p.supplier_id; 新しい実行計画が取得されている
DBMS_SPM.REPORT_AUTO_EVOLVE_TASK(EXECUTION_NAME=>‘SYS_SPM_2023-01-24/01:34:31‘) ------------------------------------------------------------------------------------------------- GENERAL INFORMATION SECTION ---------------------------------------------------------------------------------------- Task Information: --------------------------------------------------- Task Name : SYS_AUTO_SPM_EVOLVE_TASK Task Owner : SYS Description : Automatic SPM Evolve task Execution Name : SYS_SPM_2023-01-24/01:34:31 ・ ・ ・ FINDINGS SECTION ---------------------------------------------------------------------------------------- Findings (2): ---------------------------- 1. The plan was verified in 1.13300 seconds. It passed the benefit criterion because its verified performance was 4351.41205 times better than that of the baseline plan. 2. The plan was automatically accepted.