profile

简介: SQL> declare 2 v_hints sys.sqlprof_attr; 3 begin 4 v_hints:=sys.sqlprof_attr('full(test)'); 5 dbms_sqltune.

SQL> declare
2 v_hints sys.sqlprof_attr;
3 begin
4 v_hints:=sys.sqlprof_attr('full(test)');
5 dbms_sqltune.import_sql_profile('select * from ovsee.test where id =1',
6 v_hints,'SQLPROFILE_NAME1',force_match=>true);
7 end;
8 /

PL/SQL procedure successfully completed.

SQL> set autotrace trace explain;
SQL> select * from ovsee.test where id =1;

Execution Plan

Plan hash value: 3230054581



| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |



| 0 | SELECT STATEMENT | | 1 | 35 | 1 (0)|
00:00:01 |

| 1 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 35 | 1 (0)|
00:00:01 |

|* 2 | INDEX RANGE SCAN | IDX_TEST_ID | 1 | | 1 (0)|
00:00:01 |



Predicate Information (identified by operation id):

2 - access("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)
  • SQL profile "SQLPROFILE_NAME1" used for this statement

SQL> select /+full(test)/ * from ovsee.test where id =1;

no rows selected

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

PLAN_TABLE_OUTPUT

SQL_ID gh3h5nq2zcw7d, child number 0

select /+full(test)/ * from ovsee.test where id =1

Plan hash value: 217508114


| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

| 0 | SELECT STATEMENT | | | | 2 (100)| |

|* 1 | TABLE ACCESS FULL| TEST | 1 | 35 | 2 (0)| 00:00:01 |

Outline Data

/*+

  BEGIN_OUTLINE_DATA
  IGNORE_OPTIM_EMBEDDED_HINTS
  OPTIMIZER_FEATURES_ENABLE('11.2.0.4')
  DB_VERSION('11.2.0.4')
  OPT_PARAM('_b_tree_bitmap_plans' 'false')
  ALL_ROWS
  OUTLINE_LEAF(@"SEL$1")
  FULL(@"SEL$1" "TEST"@"SEL$1")
  END_OUTLINE_DATA

*/

Predicate Information (identified by operation id):

1 - filter("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)

37 rows selected.

SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> declare
2 v_hints sys.sqlprof_attr;
3 begin
4 v_hints:=sys.sqlprof_attr('FULL(@"SEL$1" "TEST"@"SEL$1")');
5 dbms_sqltune.import_sql_profile('select * from ovsee.test where id =1',
6 v_hints,'SQLPROFILE_NAME1',force_match=>true,replace=>true);
7 end;
8 /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select * from ovsee.test where id =1;

no rows selected

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

PLAN_TABLE_OUTPUT

SQL_ID gnrk70cay86mf, child number 0

select * from ovsee.test where id =1

Plan hash value: 217508114


| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

| 0 | SELECT STATEMENT | | | | 2 (100)| |

|* 1 | TABLE ACCESS FULL| TEST | 1 | 35 | 2 (0)| 00:00:01 |

Outline Data

/*+

  BEGIN_OUTLINE_DATA
  IGNORE_OPTIM_EMBEDDED_HINTS
  OPTIMIZER_FEATURES_ENABLE('11.2.0.4')
  DB_VERSION('11.2.0.4')
  OPT_PARAM('_b_tree_bitmap_plans' 'false')
  ALL_ROWS
  OUTLINE_LEAF(@"SEL$1")
  FULL(@"SEL$1" "TEST"@"SEL$1")
  END_OUTLINE_DATA

*/

Predicate Information (identified by operation id):

1 - filter("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)
  • SQL profile SQLPROFILE_NAME1 used for this statement

38 rows selected.

SQL>

目录
相关文章
|
存储 C语言
C语言自定义类型_枚举&联合(3)
C语言自定义类型_枚举&联合(3)
173 1
|
存储 传感器 监控
InfluxDB与MySQL的性能测试
InfluxDB与MySQL的性能测试
InfluxDB与MySQL的性能测试
|
测试技术 C++ Python
糖果-蓝桥杯19省赛
糖果-蓝桥杯19省赛
202 0
|
C#
C#基础知识回顾-- 反射(1)
   反射(reflection)是一种允许用户获得类型信息的C#特性。术语“反射”源自于它的工作方式: Type对象映射它所代表的底层对象。对Type对象进行查询可以获得(反射)与类型相关的信息。
787 0
|
前端开发
onsubmit 校验表单时利用 ajax 的 return false 无效问题
前几天,在校验一个表单数据时用到ajax时,遇到 return false 无效问题。/** * 表单提交校验 **/ function onSubmit(){ if($('#name').val().length
1033 0
|
11天前
|
数据采集 人工智能 安全