zoukankan      html  css  js  c++  java
  • index_ss hint 使用的运行计划变化对照

    index_ss  hint 使用的运行计划变化对照

    当中 buffer 代表:当前操作中发生的内存读次数,包括一致性读和当前读

    尽管 emp 表记录数不多,可是buffer 读内存的次数区别还是有点大的

    SQL>  select  job from emp where ename='SMITH';

    JOB
    ------------------
    CLERK

    SQL> select * from table(dbms_xplan.display_cursor(null,null,'allstats last'))

    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  at8ssqpn41css, child number 0
    -------------------------------------
     select /*+ index_ss(emp i_emp)*/ job from emp where ename='SMITH'

    Plan hash value: 3956160932

    ------------------------------------------------------------------------------------
    | Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ------------------------------------------------------------------------------------
    |*  1 |  TABLE ACCESS FULL| EMP  |      1 |      1 |      1 |00:00:00.01 |       8 |
    ------------------------------------------------------------------------------------

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

    Predicate Information (identified by operation id):
    ---------------------------------------------------

       1 - filter("ENAME"='SMITH')


    17 rows selected.

    ----创建一个索引

    SQL>  create index i_emp on emp(empno, ename);

    Index created.

    SQL> select /*+ index_ss(emp i_emp)*/ job from emp where ename='SMITH';

    JOB
    ------------------
    CLERK

    SQL>  select * from table(dbms_xplan.display_cursor(null,null,'allstats last'))
      2  ;

    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  ck2pc7bpbzdz8, child number 0
    -------------------------------------
    select /*+ index_ss(emp i_emp)*/ job from emp where ename='SMITH'

    Plan hash value: 98078853

    -----------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name  | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    -----------------------------------------------------------------------------------------------
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP   |      1 |      1 |      1 |00:00:00.01 |       3 |
    |*  2 |                 INDEX SKIP SCAN           | I_EMP |      1 |      1 |      1 |00:00:00.01 |       2 |

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

    Predicate Information (identified by operation id):
    ---------------------------------------------------

       2 - access("ENAME"='SMITH')
           filter("ENAME"='SMITH')


    19 rows selected.

  • 相关阅读:
    将Emacs Org mode用于GTD任务管理
    以Emacs Org mode为核心的任务管理方案
    Epson L4158打印机安装与配置
    使用wget命令下载网络资源
    Apt下载安装包时Hash校验和不符
    Deep Learning专栏--FFM+Recurrent Entity Network的端到端方案
    Deep Learning专栏--强化学习之从 Policy Gradient 到 A3C(3)
    Deep Learning专栏--强化学习之MDP、Bellman方程(1)
    Deep Learning基础--Softmax求导过程
    Deep Learning基础--随时间反向传播 (BackPropagation Through Time,BPTT)推导
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/4011302.html
Copyright © 2011-2022 走看看