根据不同的绑定变量的值来选择不同的执行计划测试(Select different execution plan tests based on the value of the different binding variables).docVIP

  • 1
  • 0
  • 约4.36千字
  • 约 13页
  • 2017-10-07 发布于河南
  • 举报

根据不同的绑定变量的值来选择不同的执行计划测试(Select different execution plan tests based on the value of the different binding variables).doc

根据不同的绑定变量的值来选择不同的执行计划测试(Select different execution plan tests based on the value of the different binding variables)

根据不同的绑定变量的值来选择不同的执行计划测试(Select different execution plan tests based on the value of the different binding variables) 自适应游标共享功能实现了根据不同的绑定变量的值来选择不同的执行计划测试 个人分类:性能优化 自适应游标共享功能实现了根据不同的绑定变量的值来选择不同的执行计划测试 1。清除缓存 改变系统冲洗shared_pool; 改变系统冲洗buffer_cache; 2。重置优化器的参数 改变会话设置optimizer_mode = all_rows; 改变会话设置optimizer_index_cost_adj = 100; 改变会话设置optimizer_index_caching = 0; 三.建立测试表 滴表清除; 创建表(身份证号、姓名VARCHAR2(30)); 插入T选择MOD(行号,2),object_name从all_objects; 插入T选择2,测试的双; 创建t_ind T指数(ID); 执行dbms_stats。gather_table_stats(用户,不,级联= 真的,method_opt = “栏目ID大小254); 4。字段值的选择性 选择ID,计数(*)CNT 从T 按id分组; 选择ID,计数(*)CNT 2从T 3组按ID; ID CNT ---------- ---------- 1 70339 2 1 0 70338 选择计数(*)CNT 从T; 选择计数(*)CNT 2来自t; 碳纳米管 ---------- 十四万零六百七十八 列id值“2”的选择性:1/140678=0.000007。 列id值“1”的选择性:70339/140678=0.5。 列id值“0”的选择性:70338/140678=0.4999。 5。0值来执行一个查询用: 无功v_id数; 执行:v_id:= 0; 套系200 柱plan_table_output格式A100 select count(名称)从id是:v_id; SELECT * FROM表(dbms_xplan。display_cursor); SQL SELECT * FROM表(dbms_xplan。display_cursor); plan_table_output ---------------------------------------------------------------------------------------------------- sql_id gsmm31bu4zyca,孩子0号 ------------------------------------- select count(名称)从id是:v_id 计划哈希值:2966233522 --------------------------------------------------------------------------- | ID |操作|名字|行|字节|成本(CPU)|时间| --------------------------------------------------------------------------- | 0 | SELECT语句| | | | 172(100)| | | 1 |排序总| | 1 | 25 | | | plan_table_output ---------------------------------------------------------------------------------------------------- |×2 |表访问全| T | 71629 | 1748k | 172(2)| 00:00:03 | --------------------------------------------------------------------------- [评论]查询选择表扫描 选择child_number,处决,buffer_gets,is_bind_sensitive,is_bind_aware,plan_hash_value从V$SQL,sql_id =“gsmm31bu4zyca”; child_number处决buffer_gets我plan_hash_value ------------ ---------- ----------- - --------------- 0 1 625 2966233522 [评论]这个子游标是绑定变量敏感和不绑定变量感知 6。2值来执行一个查询用: 执行:v_id:= 2; select count(名称

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档