- 最后登录
- 2018-11-1
- 在线时间
- 377 小时
- 威望
- 29
- 金钱
- 6866
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 891
- 精华
- 4
- 积分
- 29
- UID
- 1
|
3#
发表于 2012-12-25 14:30:18
test- 1* select t1,t2 from comparetab where t1<t2
- SQL> /
- 99999 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 87756 | 2228K| 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 87756 | 2228K| 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1"<"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 0 recursive calls
- 0 db block gets
- 6824 consistent gets
- 29 physical reads
- 0 redo size
- 1773851 bytes sent via SQL*Net to client
- 73869 bytes received via SQL*Net from client
- 6668 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 99999 rows processed
- SQL>
- SQL> create index ind_compare on comparetab(t1,t2);
- Index created.
- SQL> select t1,t2 from comparetab where t1<t2;
- 99999 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 87756 | 2228K| 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 87756 | 2228K| 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1"<"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 5 recursive calls
- 0 db block gets
- 6881 consistent gets
- 0 physical reads
- 0 redo size
- 1773851 bytes sent via SQL*Net to client
- 73869 bytes received via SQL*Net from client
- 6668 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 99999 rows processed
- SQL> alter system flush shared_pool;
- System altered.
- SQL> select t1,t2 from comparetab where t1<t2;
- 99999 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 87756 | 2228K| 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 87756 | 2228K| 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1"<"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 44 recursive calls
- 0 db block gets
- 6930 consistent gets
- 1 physical reads
- 0 redo size
- 1773851 bytes sent via SQL*Net to client
- 73869 bytes received via SQL*Net from client
- 6668 SQL*Net roundtrips to/from client
- 4 sorts (memory)
- 0 sorts (disk)
- 99999 rows processed
- SQL> select t1,t2 from comparetab where t1>t2;
- no rows selected
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 2 | 52 | 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 2 | 52 | 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1">"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 5 recursive calls
- 0 db block gets
- 214 consistent gets
- 0 physical reads
- 0 redo size
- 402 bytes sent via SQL*Net to client
- 532 bytes received via SQL*Net from client
- 1 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 0 rows processed
- SQL> set arraysize 5000
- SQL> select t1,t2 from comparetab where t1<t2;
- 99999 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 87756 | 2228K| 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 87756 | 2228K| 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1"<"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 0 recursive calls
- 0 db block gets
- 177 consistent gets
- 0 physical reads
- 0 redo size
- 504274 bytes sent via SQL*Net to client
- 752 bytes received via SQL*Net from client
- 21 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 99999 rows processed
- SQL> select t1,t2 from comparetab where t1>t2;
- no rows selected
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 2 | 52 | 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 2 | 52 | 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1">"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 4 recursive calls
- 0 db block gets
- 214 consistent gets
- 0 physical reads
- 0 redo size
- 402 bytes sent via SQL*Net to client
- 532 bytes received via SQL*Net from client
- 1 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 0 rows processed
- SQL>
- SQL> create index fun_ind on comparetab(t1-t2);
- Index created.
- SQL>
- SQL> select t1,t2 from comparetab where t1>t2;
- no rows selected
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 782809411
- --------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 2 | 52 | 47 (3)| 00:00:01 |
- |* 1 | TABLE ACCESS FULL| COMPARETAB | 2 | 52 | 47 (3)| 00:00:01 |
- --------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter("T1">"T2")
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 5 recursive calls
- 0 db block gets
- 215 consistent gets
- 0 physical reads
- 0 redo size
- 402 bytes sent via SQL*Net to client
- 532 bytes received via SQL*Net from client
- 1 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 0 rows processed
- SQL> select t1,t2 from comparetab where t1-t2>0;
- no rows selected
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 1278306072
- --------------------------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 4388 | 167K| 5 (0)| 00:00:01 |
- | 1 | TABLE ACCESS BY INDEX ROWID BATCHED| COMPARETAB | 4388 | 167K| 5 (0)| 00:00:01 |
- |* 2 | INDEX RANGE SCAN | FUN_IND | 790 | | 3 (0)| 00:00:01 |
- --------------------------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 2 - access("T1"-"T2">0)
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 6 recursive calls
- 0 db block gets
- 62 consistent gets
- 1 physical reads
- 0 redo size
- 402 bytes sent via SQL*Net to client
- 532 bytes received via SQL*Net from client
- 1 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 0 rows processed
- SQL> select t1,t2 from comparetab where t1-t2<0;
- 99999 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 1278306072
- --------------------------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 4388 | 167K| 5 (0)| 00:00:01 |
- | 1 | TABLE ACCESS BY INDEX ROWID BATCHED| COMPARETAB | 4388 | 167K| 5 (0)| 00:00:01 |
- |* 2 | INDEX RANGE SCAN | FUN_IND | 790 | | 3 (0)| 00:00:01 |
- --------------------------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 2 - access("T1"-"T2"<0)
- Note
- -----
- - dynamic sampling used for this statement (level=2)
- Statistics
- ----------------------------------------------------------
- 4 recursive calls
- 0 db block gets
- 462 consistent gets
- 209 physical reads
- 0 redo size
- 504274 bytes sent via SQL*Net to client
- 752 bytes received via SQL*Net from client
- 21 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 99999 rows processed
复制代码 |
|