cluster factor是影响cost of index scan的一个重要因素!到底cluster factor是怎么计算出来的?是指什么,下面的链接讨论的很清楚了!
http://www.itpub.net/858950.html
SQL> create table t1(id int , name varchar2(50)) tablespace dmt pctfree 99 pctus
ed 1;
表已创建。
SQL> insert into t1 values(2 , rpad('b' , 50));
已创建 1 行。
SQL> insert into t1 values(1 , rpad('a' , 50));
已创建 1 行。
SQL> insert into t1 values(3 , rpad('c' , 50));
已创建 1 行。
SQL> insert into t1 values(4 , rpad('d' , 50));
已创建 1 行。
SQL> commit;
提交完成。
SQL> select id , name , rowid from t1;
ID NAME ROWID
---------- -------------------------------------------------- ------------------
2 b AAAC/rAAHAAAAANAAA
1 a AAAC/rAAHAAAAAOAAA
3 c AAAC/rAAHAAAAAPAAA
4 d AAAC/rAAHAAAAAQAAA
SQL> create index idx_t1 on t1(name);
索引已创建。
SQL> select leaf_blocks,clustering_factor from dba_indexes
2 where index_name='IDX_T1';
LEAF_BLOCKS CLUSTERING_FACTOR
----------- -----------------
1 4
SQL> drop index idx_t1;
索引已删除。
SQL> create index idx_t1 on t1(name) pctfree 99;
索引已创建。
SQL> select leaf_blocks,clustering_factor from dba_indexes
2 where index_name='IDX_T1';
LEAF_BLOCKS CLUSTERING_FACTOR
----------- -----------------
4 4
SQL>
试验主要是想验证一下cluster factor是如何被计算的
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/19602/viewspace-61734/ ,如需转载,请注明出处,否则将追究法律责任。