`
rongxr
  • 浏览: 8298 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

什么是INDEX SKIP SCAN

阅读更多
在查看SQL的执行计划的时候,有时候会看到INDEX SKIP SCAN,其实这个索引扫描路径会发生在多个列建立的复合索引上,如果SQL中谓词条件只包含索引中的部分列,并且这些列不是建立索引时的第一列时,就可 能发生INDEX SKIP SCAN。这里SKIP的意思是因为查询条件没有第一列或前面几列,被忽略了。

引用Oracle文档的例子,比如如下的表:

    employees (sex, employee_id, address)

建立如下索引:

    (sex, employee_id)

如果索引包含如下的数据:

    ('F',98)
    ('F',100)
    ('F',102)
    ('F',104)
    ('M',101)
    ('M',103)
    ('M',105)

索引结构图示如下:


这时如果我们执行以下查询就会触发走INDEX SKIP SCAN:

    SELECT *
       FROM employees
    WHERE employee_id = 101;


这里sex就会被忽略掉了,实际上Oracle并没有真正忽略,而是在逻辑上拆分为2个子索引来查询而已。
分享到:
评论

相关推荐

    sql学习 07.INDEX SKIP SCAN.sql

    sql学习 07.INDEX SKIP SCAN.sql

    MySQL 8.0 之索引跳跃扫描(Index Skip Scan)

    MySQL 8.0.13开始支持 index skip scan 也即索引跳跃扫描。该优化方式支持那些SQL在不符合组合索引最左前缀的原则的情况,优化器依然能组使用组合索引。 talk is cheap ,show me the code 实践 使用官方文档的例子...

    index索引使用模式

    index索引的5种使用模式: 1。INDEX UNIQUE SCAN 效率最高,主键或唯一索引 2。INDEX FULL SCAN 有顺序的输出,不能并行读索引 3。INDEX FAST FULL SCAN 读...INDEX SKIP SCAN 联合索引,不同值越少的列,越要放在前面

    Oracle 9i用索引跳跃扫描提高查询速度

    索引跳跃式扫描(index skip scan)是Oracle9i的一个新的执行特性,尤其适用于使用连接索引和访问多值索引的Oracle查询。Oracle9i的索引跳跃式扫描执行规则允许使用连接索引,即使SQL查询中不指定性别。 这一特性使得...

    简单谈谈MySQL的loose index scan

    各种资料关于loose index scan的解释很拗口,其实等同于oracle的index skip scan。今天我们就来详细看看loose index scan的使用

    Oracle CBO优化模式中的5种索引访问方法浅析

    4.索引跳跃扫描(INDEX SKIP SCAN) 5.索引快速全扫描(INDEX FAST FULL SCAN) 索引唯一扫描(INDEX UNIQUE SCAN) 通过这种索引访问数据的特点是对于某个特定的值只返回一行数据,通常如果在查询谓语中使用UNIQE和...

    Oracle分区技术介绍

    there is no way to identify and skip subsets of irrelevant rows. The problem is particularly important for historical tables, for which many queries concentrate access on rows that were generated ...

    OutlookAttachView v2.73

    scan or skip by choosing them from the list of Outlook folders. * Version 1.75 o Added the ability to choose the desired Outlook profile inside the 'Mailbox Scan Options' window. * Version 1.72 ...

    全面的算法代码库

    凸包算法(Graham扫描法) Graham-Scan 辗转相除法求最大公约数 Greatest-Common-Divisor 堆排序 Heap-Sort ISAP算法 Improved-Shortest-Augmenting-Path(Naive) 插入排序 Insertion-Sort 字符串匹配(KMP) ...

    grub4dos-V0.4.6a-2017-02-04更新

    1.skip_to()函数修改,对于引号里面的”\”使用以前的方法处理,保持兼容性。(chenall) 2.add variable @boot,add debug info。(chenall) 3.two variables boot_drive and install_partition can be preset to a ...

    The Art of Assembly Language Programming

    You are visitor as of October 17, 1996. The Art of Assembly Language Programming <br>Forward Why Would Anyone Learn This Stuff? 1 What's Wrong With Assembly Language 2 What's Right With ...

    iso-iec 14496-10(3rd_2006-03-01)_MPEG4_AVC_H264.pdf

    Contents Page 0 Introduction.................................................................................................................................................................

Global site tag (gtag.js) - Google Analytics