index unique scan vs index full scan
2009-09-20 20:52
357 查看
index unique scan ,是因为建了唯一索引, unique
如 :create unique index AA_INDEX on AA_TEST (SID, ITEMVALUE)
在执行语句中 where子句必须包括 唯一索引中的所有字段,而不用管select是否是索引中的字段.
analyze table aa_test compute statistics;
select sid,itemvalue from aa_test t where sid=1;
这个用 index range scan
select sid,itemvalue from aa_test t where itemvalue ='100';
这个用index full scan
也就是说如果在where子句中没有选择 唯一索引的前置索引字段,而是唯一索引的其他的字段,就会变成
index full scan
而对其他索引(不是唯一索引)中,只用索引中的某个字段(不是前置),只是 index range scan,不是index full scan,
从某些文档中知道 index full scan是index range scan的一个极限,当从index的叶子从左找到右时,就是index full scan.
下面是强制用 跳跃索引
select /*+ index_ss(aa_t inde_aa_t) */ aa_t.object_type
from aa_t where object_id =2
from :http://space.itpub.net/12712263/viewspace-606960
如 :create unique index AA_INDEX on AA_TEST (SID, ITEMVALUE)
在执行语句中 where子句必须包括 唯一索引中的所有字段,而不用管select是否是索引中的字段.
analyze table aa_test compute statistics;
select sid,itemvalue from aa_test t where sid=1;
这个用 index range scan
select sid,itemvalue from aa_test t where itemvalue ='100';
这个用index full scan
也就是说如果在where子句中没有选择 唯一索引的前置索引字段,而是唯一索引的其他的字段,就会变成
index full scan
而对其他索引(不是唯一索引)中,只用索引中的某个字段(不是前置),只是 index range scan,不是index full scan,
从某些文档中知道 index full scan是index range scan的一个极限,当从index的叶子从左找到右时,就是index full scan.
下面是强制用 跳跃索引
select /*+ index_ss(aa_t inde_aa_t) */ aa_t.object_type
from aa_t where object_id =2
from :http://space.itpub.net/12712263/viewspace-606960
相关文章推荐
- Oracle:index fast full scan VS. index skip scan (未解决)
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- ORACLE FAST FULL INDEX SCAN vs. INDEX RANGE SCANS
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- INDEX FULL SCAN vs INDEX FAST FULL SCAN
- Index Full Scan vs Index Fast Full Scan
- oracle编程入门笔记2015-01-19--index fast full scan
- Index Scan or Full Table Scan: The “Magic” Number (Magic Dance)
- INDEX FAST FULL SCAN AND SKIP SCAN
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL 有什么区别?各适用于什么场合?
- Index Full Scan && Index Range Scan
- ORACLE优化之执行规划(1) - TABLE FULL SCAN/INDEX FULL SCAN
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL 有什么区别?各适用于什么场合?
- unique index vs non-unique index
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL 有什么区别?各适用于什么场合?
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL 有什么区别?各适用于什么场合?
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL