Index rebuild --case 1
實驗條件:
1、非ASSM表空間
2、索引建立,CF值接近Blocks數量
3、索引列不超過表列10%
4、測試查詢不同數量的行,索引碎片造成的影響情況
實驗:
SQL> create tablespace perfstat datafile
'/home/simskf/simskfdbs/oradata/simskf/perfstat.dbf' size 600m
extent management local uniform. size 1M
segment space management manual;
SQL>create table t1 (id number, pad char(50), name1 char(50), name2 char(50),
name3 char(50), name4 char(50), name5 char(50), name6 char(50), name7 char(50), name8 char(50), name9 char(50));
SQL>insert into t1 select rownum, rpad('1234567890' ,50), 'test1', 'test2', 'test3', 'test4', 'test5', 'test6', 'test7', 'test8', 'test9' from dual connect by level<=100000;
SQL>commit;
SQL>create index t1_idx on t1 (id, pad) pctfree 0;
SQL>begin
dbms_stats.gather_table_stats(
user,
'T1',
cascade=>true,
estimate_percent=>null,
method_opt=>'for all columns size 1'
);
end;
/
1rows 0.001% select * from t1 where id =200;
10 rows 0.01% select * from t1 where id between 10 and 19;
100 rows 0.1% select * from t1 where id between 500 and 599;
1000rows 1% select * from t1 where id between 3000 and 3999;
5000 rows 5% select * from t1 where id between 5000 and 9999;
10000 rows 10% select * from t1 where id between 10000 and 19999
100000 rows 100% select /*+ index(t1_idx) */ * from t1 where id between 1 and 100000;
100000 rows(FTS) 100% select /*+ index_ffs(t1_idx) */ * from t1 where id between 1 and 100000;
analyze index t1_idx validate structure;
PCTFREE=0
SQL> select HEIGHT,BR_BLKS,LF_BLKS ,PCT_USED from index_stats;
HEIGHT BR_BLKS LF_BLKS PCT_USED
---------- ---------- ---------- ----------
3 3 839 100
1rows Elapsed: 00:00:00.01
10rows Elapsed: 00:00:00.23
100rows Elapsed: 00:00:02.70
1、非ASSM表空間
2、索引建立,CF值接近Blocks數量
3、索引列不超過表列10%
4、測試查詢不同數量的行,索引碎片造成的影響情況
實驗:
SQL> create tablespace perfstat datafile
'/home/simskf/simskfdbs/oradata/simskf/perfstat.dbf' size 600m
extent management local uniform. size 1M
segment space management manual;
SQL>create table t1 (id number, pad char(50), name1 char(50), name2 char(50),
name3 char(50), name4 char(50), name5 char(50), name6 char(50), name7 char(50), name8 char(50), name9 char(50));
SQL>insert into t1 select rownum, rpad('1234567890' ,50), 'test1', 'test2', 'test3', 'test4', 'test5', 'test6', 'test7', 'test8', 'test9' from dual connect by level<=100000;
SQL>commit;
SQL>create index t1_idx on t1 (id, pad) pctfree 0;
SQL>begin
dbms_stats.gather_table_stats(
user,
'T1',
cascade=>true,
estimate_percent=>null,
method_opt=>'for all columns size 1'
);
end;
/
1rows 0.001% select * from t1 where id =200;
10 rows 0.01% select * from t1 where id between 10 and 19;
100 rows 0.1% select * from t1 where id between 500 and 599;
1000rows 1% select * from t1 where id between 3000 and 3999;
5000 rows 5% select * from t1 where id between 5000 and 9999;
10000 rows 10% select * from t1 where id between 10000 and 19999
100000 rows 100% select /*+ index(t1_idx) */ * from t1 where id between 1 and 100000;
100000 rows(FTS) 100% select /*+ index_ffs(t1_idx) */ * from t1 where id between 1 and 100000;
analyze index t1_idx validate structure;
PCTFREE=0
SQL> select HEIGHT,BR_BLKS,LF_BLKS ,PCT_USED from index_stats;
HEIGHT BR_BLKS LF_BLKS PCT_USED
---------- ---------- ---------- ----------
3 3 839 100
1rows Elapsed: 00:00:00.01
10rows Elapsed: 00:00:00.23
100rows Elapsed: 00:00:02.70
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-614916/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- alter index ind1 rebuild 和alter index ind1 rebuild onlineIndexRebuild
- rebuild indexRebuildIndex
- index rebuildIndexRebuild
- rebuild index 排序RebuildIndex排序
- sybase rebuild indexRebuildIndex
- alter index rebuild 與 rebuild onlineIndexRebuild
- alter index rebuild與index_statsIndexRebuild
- ORACLE中index的rebuildOracleIndexRebuild
- Index Online RebuildIndexRebuild
- 【羅玄】從鎖的角度看rebuild index online和rebuild indexRebuildIndex
- 聊聊索引Index Rebuild和Rebuild Online(下)索引IndexRebuild
- 聊聊索引Index Rebuild和Rebuild Online(上)索引IndexRebuild
- Oracle alter index rebuild 說明OracleIndexRebuild
- alter index rebuild和rebuild online的區別IndexRebuild
- rebuild index 和 recreate index (重新建立index) 的區別RebuildIndex
- create index , rebuild index troubleshooting 索引故障解決IndexRebuild索引
- create index online 與rebuild index onlineIndexRebuild
- create index online 與rebuild index onlineIndexRebuild
- index rebuild online的問題IndexRebuild
- 大資料量rebuild index的經歷大資料RebuildIndex
- Oracle效能優化之“少做事”(rebuild index)Oracle優化RebuildIndex
- Oracle什麼情況下需要rebuild indexOracleRebuildIndex
- 加快create / rebuild index的3個點(zt)RebuildIndex
- Default behavior of create & rebuild index in 10G (zt)RebuildIndex
- 加快建立索引(create / rebuild index) 的幾點索引RebuildIndex
- 關於rebuild index online 及drop index後重建問題RebuildIndex
- 重建索引index rebuild online vs offline vs index coalesce vs index shrik space索引IndexRebuild
- Bug 12537403 : ORA-00701 ON I_OBJ1 INDEX REBUILDOBJIndexRebuild
- alter index rebuild online引發的血案IndexRebuild
- 測試index online rebuild故障記錄IndexRebuild
- alter index ... rebuild online的機制(zt)IndexRebuild
- “rebuild index online hang住" 問題解析RebuildIndex
- Oracle vs PostgreSQL Develop(30) - Index&Case whenOracleSQLdevIndex
- INDEX REBUILD和INDEX REORGANIZE和UPDATE STATISTICS是否涉及Sch-M的案例分析IndexRebuild
- rebuild index online的鎖機制淺析RebuildIndex
- Online rebuild index遭遇ORA-08104RebuildIndex
- 【MOS】Index Rebuild Is Hanging Or Taking Too Long (文件 ID 272762.1)IndexRebuild
- 關於move table和rebuild index批量操作的記錄RebuildIndex