no_merge的含义

create table wxh_tbd1 as select * from dba_objects;
create table wxh_tbd2 as select * from dba_objects;

create index ind_oi on wxh_tbd1(object_name);
create index t_22 on wxh_tbd1(object_id);
create index t_23 on wxh_tbd2(object_id);

create view v_tbd2
as
select a.object_id,a.object_name,b.object_type from wxh_tbd1 a,wxh_tbd2 b
where a.object_id=b.object_id;

select /*+ no_merge(d) */* from wxh_tbd1 c,v_tbd2 d
where c.object_id=d.object_id and c.object_name='WXH_TBD';

select * from wxh_tbd1 c,v_tbd2 d
where c.object_id=d.object_id and c.object_name='WXH_TBD';

 

-------------------------------------------------------------------------------------------
| Id  | Operation                      | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |          |     1 |   131 |     6   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                  |          |       |       |            |          |
|   2 |   NESTED LOOPS                 |          |     1 |   131 |     6   (0)| 00:00:01 |
|   3 |    NESTED LOOPS                |          |     1 |   118 |     4   (0)| 00:00:01 |
|   4 |     TABLE ACCESS BY INDEX ROWID| WXH_TBD1 |     1 |    94 |     2   (0)| 00:00:01 |
|*  5 |      INDEX RANGE SCAN          | IND_OI   |     1 |       |     1   (0)| 00:00:01 |
|   6 |     TABLE ACCESS BY INDEX ROWID| WXH_TBD1 |     1 |    24 |     2   (0)| 00:00:01 |
|*  7 |      INDEX RANGE SCAN          | T_22     |     1 |       |     1   (0)| 00:00:01 |
|*  8 |    INDEX RANGE SCAN            | T_23     |     1 |       |     1   (0)| 00:00:01 |
|   9 |   TABLE ACCESS BY INDEX ROWID  | WXH_TBD2 |     1 |    13 |     2   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------

Statistics
----------------------------------------------------------
          8  recursive calls
          0  db block gets
         36  consistent gets
         21  physical reads
          0  redo size
       2138  bytes sent via SQL*Net to client
        524  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          5  rows processed

-----------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |     1 |   184 |   132   (2)| 00:00:02 |
|*  1 |  HASH JOIN                   |          |     1 |   184 |   132   (2)| 00:00:02 |
|   2 |   TABLE ACCESS BY INDEX ROWID| WXH_TBD1 |     1 |    94 |     2   (0)| 00:00:01 |
|*  3 |    INDEX RANGE SCAN          | IND_OI   |     1 |       |     1   (0)| 00:00:01 |
|   4 |   VIEW                       | V_TBD2   | 20082 |  1765K|   130   (2)| 00:00:02 |
|*  5 |    HASH JOIN                 |          | 20082 |   725K|   130   (2)| 00:00:02 |
|   6 |     TABLE ACCESS FULL        | WXH_TBD2 | 20151 |   255K|    64   (0)| 00:00:01 |
|   7 |     TABLE ACCESS FULL        | WXH_TBD1 | 20151 |   472K|    64   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------

Statistics
----------------------------------------------------------
          8  recursive calls
          0  db block gets
        568  consistent gets
        552  physical reads
          0  redo size
       2138  bytes sent via SQL*Net to client
        524  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          5  rows processed

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

转载于:http://blog.itpub.net/22034023/viewspace-703648/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值