ITPub博客

首页 > Linux操作系统 > Linux操作系统 > min ? max ? 执行计划? (续)

min ? max ? 执行计划? (续)

原创 Linux操作系统 作者:lfree 时间:2007-04-29 00:00:00 0 删除 编辑

链接:
http://lfree.itpub.net/post/4950/284166

create table big_table as select * from dba_objects;
insert into big_table select * from big_table;
insert into big_table select * from big_table;

ALTER TABLE BIG_TABLE MODIFY(OBJECT_ID NULL);

CREATE INDEX I_BT_OBJECT_ID ON BIG_TABLE(OBJECT_ID)

如果修改
select min(object_id),max(object_id) from big_table;

select min(object_id),min(object_id) from big_table;


----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 307 (4)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
| 2 | INDEX FAST FULL SCAN| I_BT_OBJECT_ID | 405K| 1978K| 307 (4)| 00:00:04 |
----------------------------------------------------------------------------------------


Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
1386 consistent gets
0 physical reads
0 redo size
484 bytes sent via SQL*Net to client
384 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

可以发现oracle并没有选择合适的执行语句。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-83021/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2485
  • 访问量
    6290641