使用SPM来稳定执行计划(7)

OBJECT_ID
 ----------
 OBJECT_NAME
 --------------------------------------------------------------------------------
        106
 I_DEPENDENCY1

107
 I_DEPENDENCY2

108
 I_ACCESS1

6 rows selected.

SQL> select * from table(dbms_xplan.display_cursor(null,null,'advanced'));

PLAN_TABLE_OUTPUT
 --------------------------------------------------------------------------------
 SQL_ID    8vtdn0kgytfxr, child number 2
 -------------------------------------
 select object_id,object_name from t2 where object_id between 103 and 108

Plan hash value: 1513984157

--------------------------------------------------------------------------
 | Id  | Operation      | Name | Rows  | Bytes | Cost (%CPU)| Time    |
 --------------------------------------------------------------------------
 |  0 | SELECT STATEMENT  |    |    |    |  339 (100)|      |
 |*  1 |  TABLE ACCESS FULL| T2    |    7 |  210 |  339  (1)| 00:00:05 |

PLAN_TABLE_OUTPUT
 --------------------------------------------------------------------------------
 --------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
 -------------------------------------------------------------

1 - SEL$1 / T2@SEL$1

Outline Data
 -------------

/*+

PLAN_TABLE_OUTPUT
 --------------------------------------------------------------------------------
      BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('11.2.0.4')
      DB_VERSION('11.2.0.4')
      ALL_ROWS
      OUTLINE_LEAF(@"SEL$1")
      FULL(@"SEL$1" "T2"@"SEL$1")
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):

PLAN_TABLE_OUTPUT
 --------------------------------------------------------------------------------
 ---------------------------------------------------

1 - filter(("OBJECT_ID"<=108 AND "OBJECT_ID">=103))

Column Projection Information (identified by operation id):
 -----------------------------------------------------------

1 - "OBJECT_NAME"[VARCHAR2,128], "OBJECT_ID"[NUMBER,22]

Note
 -----

PLAN_TABLE_OUTPUT
 --------------------------------------------------------------------------------
    - SQL plan baseline SQL_PLAN_asnmb3t5yfk40b860bcf2 used for this statement

46 rows selected.
此时已经变为走全表扫描。和sqlprofile比较起来,sqlprofile的automatic模式只能起到不调整sql的同时,调整执行计划。sqlprofile的manual模式是可以稳定执行计划的,但是这又给以后的调整带来麻烦,而SPM刚好发挥了完美的作用,既可以稳定执行计划,又可以为以后的更好的执行计划提供可能。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ef6fec6ab786148264965f6bb9b5ac5d.html