ITPub博客

首页 > Linux操作系统 > Linux操作系统 > CURSOR_SHARING=SIMILAR

CURSOR_SHARING=SIMILAR

原创 Linux操作系统 作者:wei-xh 时间:2011-11-08 14:17:51 0 删除 编辑

CURSOR_SHARING=SIMILAR

With CURSOR_SHARING=SIMILAR whenever the optimizer looks at a replaced bind value to make a decision then that bind is checked to see if it should be considered unsafe. The check made is :

Is the operator NEITHER of   ‘=’ or ‘!=’
OR
Are there Column Histograms present on the column.

If either of these are true then the bind is deemed to be unsafe and a new cursor will be created (So binds used in non equality predicates (eg >, <, >=, <=, LIKE) are unsafe). To check for whether a bind is considered unsafe see

SQL> select count(*) from dba_objects where object_id>3;

  COUNT(*)
----------
     50363

SQL> select count(*) from dba_objects where object_id>5;

  COUNT(*)
----------
     50361

SQL> select count(*) from dba_objects where object_id>6;

  COUNT(*)
----------
     50360

SQL> select count(*) from dba_objects where object_id>4;

  COUNT(*)
----------
     50362

 

SQL> select sql_id,child_number from v$sql where sql_text like '%dba_objects%';

SQL_ID        CHILD_NUMBER
------------- ------------
bg5mpjkmsjg7h            0
bg5mpjkmsjg7h            1
bg5mpjkmsjg7h            2
bg5mpjkmsjg7h            3
bg5mpjkmsjg7h            4
bg5mpjkmsjg7h            5
bg5mpjkmsjg7h            6
bg5mpjkmsjg7h            7
2r3tjryp06xfx            0:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22034023/viewspace-710434/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE组成员,DBGeeK用户组发起人。曾在DTCC、ORACLE技术嘉年华、Gdevops等公开场合做过数据库技术专题分享,2017年应Oracle邀请在世界最大的数据库会议OOW上做技术分享。组织翻译了《拨云见日,解密Oracle ASM内核》一书。

注册时间:2009-07-04

  • 博文量
    422
  • 访问量
    2425364