ITPub博客

首页 > 数据库 > Oracle > 关于COUNT STOPKEY的工作机制

关于COUNT STOPKEY的工作机制

原创 Oracle 作者:flysky0814 时间:2007-11-21 09:37:28 0 删除 编辑

SQL> select rownum rn ,a.* from cnmir.ew_auctions a where rownum<50000;

Execution Plan
----------------------------------------------------------
Plan hash value: 721966694

----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 49999 | 4833K| 163 (2)| 00:00:02 |
|* 1 | COUNT STOPKEY | | | | | |
| 2 | TABLE ACCESS FULL| EW_AUCTIONS | 49999 | 4833K| 163 (2)| 00:00:02 |
----------------------------------------------------------------------------------

SQL> select * from cnmir.ew_auctions where issue_id<80;

Execution Plan
----------------------------------------------------------
Plan hash value: 518049957

---------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 99 | 1379 (2)| 00:00:17 |
|* 1 | TABLE ACCESS FULL| EW_AUCTIONS | 1 | 99 | 1379 (2)| 00:00:17 |
---------------------------------------------------------------------------------

可见COUNT STOPKEY 机制是只针对rownum而设定的!

[@more@]

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

请登录后发表评论 登录
全部评论

注册时间:2008-03-31

  • 博文量
    53
  • 访问量
    381961