|
我的是11g 和楼主的执行计划不一样。。不知道楼主为什么要加 hints。。。。
SQL> select id,status,type,created from scott.test1 where rowid in( select rid
2 from (select rownum rn, rid
3 from (select rowid rid
4 from scott.test1 t
5 order by 1)
6 where rownum < 1000)
7 where rn > 899)
8 /
已选择100行。
执行计划
----------------------------------------------------------
Plan hash value: 878873519
------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 37 | | 83 (4)| 00:00:01 |
| 1 | NESTED LOOPS | | 1 | 37 | | 83 (4)| 00:00:01 |
| 2 | VIEW | VW_NSO_1 | 999 | 11988 | | 81 (3)| 00:00:01 |
| 3 | HASH UNIQUE | | 1 | 24975 | | | |
|* 4 | VIEW | | 999 | 24975 | | 81 (3)| 00:00:01 |
|* 5 | COUNT STOPKEY | | | | | | |
| 6 | VIEW | | 12999 | 152K| | 81 (3)| 00:00:01 |
|* 7 | SORT ORDER BY STOPKEY| | 12999 | 152K| 264K| 81 (3)| 00:00:01 |
| 8 | TABLE ACCESS FULL | TEST1 | 12999 | 152K| | 18 (0)| 00:00:01 |
| 9 | TABLE ACCESS BY USER ROWID| TEST1 | 1 | 25 | | 1 (0)| 00:00:01 |
------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
4 - filter("RN">899)
5 - filter(ROWNUM<1000)
7 - filter(ROWNUM<1000)
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
64 consistent gets
0 physical reads
0 redo size
2474 bytes sent via SQL*Net to client
415 bytes received via SQL*Net from client
8 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
100 rows processed |
|