oracle skipscan,查询条件包含组合索引所有键为啥执行计划走的是index skip scan???...
请参考!这个没有什么原因能解释,只能说是oracle一个bug!
参照CBO一书原文如下!
create index t1_i1 on t1(n1, ind_pad, n2)
More on Range-based Tests
We took the easy option, and did a range-based test on the last column in the index. What
happens if we do a range-based test on an earlier column in the index? Try this, for example:
alter session set "_optimizer_skip_scan_enabled"=false;
select
/*+ index(t1) */
small_vc
from
t1
where
n1 between 1 and 3
and ind_pad = rpad('x',40)
and n2 = 2
;
Execution Plan (8.1.7.4)
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=264 Card=82 Bytes=4756)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=264 Card=82 Bytes=4756)
2 1 INDEX (RANGE SCAN) OF 'T1_I1' (NON-UNIQUE) (Cost=184 Card=82)
Execution Plan (9.2.0.6 and 10.1.0.4)
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=264 Card=82 Bytes=4756)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=264 Card=82 Bytes=4756)
2 1 INDEX (RANGE SCAN) OF 'T1_I1' (NON-UNIQUE) (Cost=184 Card=1633)
The alter session command is there for the benefit of 9i and 10g. The unhinted execution
plan was a full tablescan, but when I first put in an index hint, the optimizer insisted on using
the index skip scan mechanism, and in 10g if I then included the no_index_ss() hint, the index
was disabled and the plan went back to a tablescan (I would be inclined to call this behavior a
bug—it seems perfectly reasonable to me to say, “Use this index, but don’t do a skip scan,” but
it is possible that it’s the specified behavior).
oracle skipscan,查询条件包含组合索引所有键为啥执行计划走的是index skip scan???...相关推荐
- oracle执行计划走索引类型,SQL执行计划问题:where条件是主键(NUMBER类型字段)LIKE :VAR,为什么执行计划不走索引?...
SQL执行计划问题:where条件是主键(NUMBER类型字段)LIKE :VAR,为什么执行计划不走索引? 中文社区 (MOSC) 数据库 (MOSC) 6 Replies Last update ...
- java sql范围查询语句,java类中写sql语句,查询条件包含换行
java类中写sql语句,查询条件包含换行 detachedCriteria.add(Restrictions.or( Restrictions.like("chengBanDanWeiId ...
- java mysql查询字段换行,java类中写sql语句,查询条件包含换行
java类中写sql语句,查询条件包含换行 detachedCriteria.add(Restrictions.or( Restrictions.like("chengBanDanWeiId ...
- PostgreSQL Oracle 兼容性之 - INDEX SKIP SCAN (递归查询变态优化) 非驱动列索引扫描优化...
标签 PostgreSQL , Oracle , index skip scan , 非驱动列条件 , 递归查询 , 子树 背景 对于输入条件在复合索引中为非驱动列的,如何高效的利用索引扫描? 在Or ...
- oracle index skip scan,索引跳跃式扫描(INDEX SKIP SCAN)
索引跳跃式扫描(INDEX SKIP SCAN) 索引跳跃式扫描(INDEX SKIP SCAN)适用于所有类型的复合B树索引(包括唯一性索引和非唯一性索引),它使那些在where条件中没有对目标索引 ...
- Mysql使用大全(MySQL架构与存储引擎 、事务 、业务设计 、索引 、数据结构 、执行计划 、数值类型)
这是一篇mysql大全,学习完这篇文章,相信在日常业务和面试完全不在问题,下面我们来一一介绍 MySQL架构与存储引擎 全局变量和会话变量 要想显式指定是否设置全局或会话变量,使用GLOBAL或SES ...
- 22-08-25 MySQL高级(03)MySQL索引、索引演绎、适合加索引的情况、执行计划Explain各字段解释
"系统,那如果我没有绑定,没有简化,我原先的人生最大的可能是怎么样的",李长生好奇一问.很快系统给出了答案. "如果宿主是小说主角的话,就活个几章" " ...
- 【测试】模拟一个全表扫描的sql,对其进行优化走索引,并且将执行计划稳定到baseLine。...
①创建表t3: SQL> create table t3 (id int);Table created.SQL> insert into t3 select level from dual ...
- sql语句分析是否走索引_MySql 的SQL执行计划查看,判断是否走索引
在select窗口中,执行以下语句: set profiling =1; -- 打开profile分析工具 show variables like '%profil%'; -- 查看是否生效 show ...
- oracle 窗口函数查询条件,62.Oracle数据库SQL开发之 高级查询——使用分析函数之窗口函数...
62.Oracle数据库SQL开发之 高级查询--使用分析函数之窗口函数 窗口函数可以计算一定的记录范围内.一定值域内.或者一段时间内的累积和以及移动平均值.查询返回一组记录,称为结果集.窗口这个术语 ...
最新文章
- 如何看待亚马逊 AI 李沐团队大批人员离职?
- How to Enable Trace or Debug for APIs executed as SQL Script Outside of the Applications ?
- python3 环境变量
- 亲爱的,热爱的~CTF
- Django学习笔记之——Forms
- 【Spring 5】响应式Web框架实战(上)
- 使用jQuery插件realshadow实现超酷真实阴影效果
- 利用Photoshop减小照片景深
- XML Schema ---complexType-----复合元素
- Java中BufferedReader和InputStreamReader
- 在linux下添加路由
- linux 下常用操作命令
- sort函数的使用(c++) bool函数使用
- linux 内核dump,linux内核调试技巧之一 dump_stack【转】
- JavaScript正则表达式19例(7)
- oracle查询functions名字,oracle 怎样查看已经存在的函数,过程?
- 美国国家人工智能研发战略规划2019
- coreldraw梯形校正_CDR图文教程-CorelDREW折叠效果怎么做?
- RabbitMQ Federation 插件使用
- Java 断点续传以及在线视频播放可选择任一时间播放原理