oracle全表扫描的优化
2010-01-06 17:04
441 查看
全表扫描的优化
analyze table t1 estimate statistics;
收集统计信息
select * from t1;
执行计划为全表扫描,假设代价为68
select /*+ full(t1) parallel(t1,4) */ * from t1;
使用并行查询的强制,代价为17
alter table t1 pctfree 0;
alter table t1 move tablespace users;
select * from t1;
执行计划为全表扫描,代价为63,比第一次要小.因为扫描的块少了.
alter system set db_file_multiblock_read_count=8;
执行计划为全表扫描,代价为98,因为一次读的块少了(默认是16),代价增加
alter system set db_file_multiblock_read_count=32;
执行计划为全表扫描,代价为40,因为一次读的块多了,代价减少
analyze table t1 estimate statistics;
收集统计信息
select * from t1;
执行计划为全表扫描,假设代价为68
select /*+ full(t1) parallel(t1,4) */ * from t1;
使用并行查询的强制,代价为17
alter table t1 pctfree 0;
alter table t1 move tablespace users;
select * from t1;
执行计划为全表扫描,代价为63,比第一次要小.因为扫描的块少了.
alter system set db_file_multiblock_read_count=8;
执行计划为全表扫描,代价为98,因为一次读的块少了(默认是16),代价增加
alter system set db_file_multiblock_read_count=32;
执行计划为全表扫描,代价为40,因为一次读的块多了,代价减少
相关文章推荐
- oracle优化:避免全表扫描
- oracle 性能优化操作十八: 决定使用全表扫描还是使用索引
- oracle 优化,全表扫描
- oracle优化全表扫描和索引使用
- oracle优化之count的优化-避免全表扫描
- Oracle优化:避免全表扫描
- Oracle 11g通过提高IO吞吐量(修改_db_file_optimizer_read_count)来优化全表扫描
- oracle优化之count的优化-避免全表扫描
- oracle优化:避免全表扫描
- oracle优化:避免全表扫描
- oracle优化之count的优化-避免全表扫描
- oracle优化:避免全表扫描
- oracle 性能优化操作十八: 决定使用全表扫描还是使用索引
- Oracle SQL优化必要的全表扫描思路分析
- oracle优化:避免全表扫描
- Oracle 11g通过提高IO吞吐量(修改_db_file_optimizer_read_count)来优化全表扫描
- oracle优化:避免全表扫描
- oracle优化避免全表扫描
- oracle优化:避免全表扫描
- 数据库优化之利用索引、避免全表扫描