zoukankan      html  css  js  c++  java
  • 索引唯一性扫描(INDEX UNIQUE SCAN)

     

         索引唯一性扫描(INDEX UNIQUE SCAN)是针对唯一性索引(UNIQUE INDEX)的扫描,它仅仅适用于where条件里是等值查询的目标SQL。因为扫描的对象是唯一性索引,所以索引唯一性扫描的结果至多只会返回一条记录。

    Emp表中empno为primary key,对应一个unique index


    SCOTT@PDBORCL> select * from emp where empno=7369;


    执行计划
    ----------------------------------------------------------
    Plan hash value: 2949544139

    --------------------------------------------------------------------------------------
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |        |     1 |    38 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |     1 |    38 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | PK_EMP |     1 |       |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------

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

       2 - access("EMPNO"=7369)


    统计信息
    ----------------------------------------------------------
             69  recursive calls
              0  db block gets
             95  consistent gets
             21  physical reads
              0  redo size
            898  bytes sent via SQL*Net to client
            533  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              8  sorts (memory)
              0  sorts (disk)
              1  rows processed

    SCOTT@PDBORCL>

    View Code

    image

    从上述显示内容可以看出,"select * from emp where empno=7369"的执行计划走的是索引唯一性扫描

  • 相关阅读:
    js如何获取当天日期的开始时间和结束时间
    bootstrapTable 刷新数据
    vue全家桶
    JavaScript数组是否存在及是否存在某个元素
    asp.net core 负载均衡集群搭建(centos7+nginx+supervisor+kestrel)
    (转) 将ASP.NET Core应用程序部署至生产环境中(CentOS7)
    mysql 5.7 docker 主从复制架构搭建
    CentOS6.x生产环境下一键安装mono+jexus的脚本,自启动,带服务,版本号自控
    使用 Json.Net 对Json文本进行 增删改查
    C# dynamic 动态创建 json
  • 原文地址:https://www.cnblogs.com/xqzt/p/4464357.html
Copyright © 2011-2022 走看看