2014年(10)
分类: Oracle
2014-12-24 10:00:37
SQL> select /*+index(t)*/ * from t_colocated t where id>=20000 and id<=40000;
已选择20001行。
已用时间: 00: 00: 02.73
执行计划
----------------------------------------------------------
Plan hash value: 4204525375
----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 22727 | 1442K| 417 (0)| 00:00:06 |
| 1 | TABLE ACCESS BY INDEX ROWID| T_COLOCATED | 22727 | 1442K| 417 (0)| 00:00:06 |
|* 2 | INDEX RANGE SCAN | PK_T_COLOCATED | 22727 | | 56 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("ID">=20000 AND "ID"<=40000)
Note
-----
- dynamic sampling used for this statement (level=2)
统计信息
----------------------------------------------------------
7 recursive calls
0 db block gets
3058 consistent gets
37 physical reads
0 redo size
2368473 bytes sent via SQL*Net to client
15182 bytes received via SQL*Net from client
1335 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
20001 rows processed
已用时间: 00: 00: 11.51
执行计划
----------------------------------------------------------
Plan hash value: 603192320
----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 24048 | 1526K| 20069 (1)| 00:04:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T_DISORGANIZED | 24048 | 1526K| 20069 (1)| 00:04:01 |
|* 2 | INDEX RANGE SCAN | PK_T_DISORG | 24048 | | 46 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("ID">=20000 AND "ID"<=40000)
Note
-----
- dynamic sampling used for this statement (level=2)
统计信息
----------------------------------------------------------
246 recursive calls
0 db block gets
21491 consistent gets
43 physical reads
0 redo size
2368473 bytes sent via SQL*Net to client
15182 bytes received via SQL*Net from client
1335 SQL*Net roundtrips to/from client
6 sorts (memory)
0 sorts (disk)
20001 rows processed