disable or 擴充套件

wei-xh發表於2011-08-01

SQL> select /*+ use_concat */ * from hao2 where object_id=1 or object_id=2 or object_id=3;


執行計劃
----------------------------------------------------------
Plan hash value: 2739802529

----------------------------------------------------------------------------------------
| Id  | Operation                    | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |         |     3 |   282 |     5   (0)| 00:00:01 |
|   1 |  INLIST ITERATOR             |         |       |       |            |          |
|   2 |   TABLE ACCESS BY INDEX ROWID| HAO2    |     3 |   282 |     5   (0)| 00:00:01 |
|*  3 |    INDEX RANGE SCAN          | HAO2IND |     3 |       |     4   (0)| 00:00:01 |
----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access("OBJECT_ID"=1 OR "OBJECT_ID"=2 OR "OBJECT_ID"=3)


統計資訊
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          9  consistent gets
          0  physical reads
          0  redo size
       1249  bytes sent via SQL*Net to client
        338  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          2  rows processed

SQL> alter session set events '10157 trace name context forever';

會話已更改。

SQL> select /*+ use_concat */ * from hao2 where object_id=1 or object_id=2 or object_id=3;


執行計劃
----------------------------------------------------------
Plan hash value: 1202901203

----------------------------------------------------------------------------------------
| Id  | Operation                    | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |         |     3 |   282 |     6   (0)| 00:00:01 |
|   1 |  CONCATENATION               |         |       |       |            |          |
|   2 |   TABLE ACCESS BY INDEX ROWID| HAO2    |     1 |    94 |     2   (0)| 00:00:01 |
|*  3 |    INDEX RANGE SCAN          | HAO2IND |     1 |       |     1   (0)| 00:00:01 |
|   4 |   TABLE ACCESS BY INDEX ROWID| HAO2    |     1 |    94 |     2   (0)| 00:00:01 |
|*  5 |    INDEX RANGE SCAN          | HAO2IND |     1 |       |     1   (0)| 00:00:01 |
|   6 |   TABLE ACCESS BY INDEX ROWID| HAO2    |     1 |    94 |     2   (0)| 00:00:01 |
|*  7 |    INDEX RANGE SCAN          | HAO2IND |     1 |       |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access("OBJECT_ID"=1)
   5 - access("OBJECT_ID"=3)
   7 - access("OBJECT_ID"=2)


統計資訊
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          9  consistent gets
          0  physical reads
          0  redo size
       1249  bytes sent via SQL*Net to client
        338  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          2  rows processed

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22034023/viewspace-703664/,如需轉載,請註明出處,否則將追究法律責任。

相關文章