硬解析物理读VS软解析逻辑读 测试

前提:了解硬解析和软解析的定义

硬解析物理读VS软解析逻辑读

这部分比较简单,无须多说,直接看结果
zo_leave@orcl> alter system set events 'immediate trace name flush_cache'; -- 清除缓冲区缓存


系统已更改。


已用时间:  00: 00: 16.44


zo_leave@orcl> alter system flush shared_pool;   -- 清除共享池


系统已更改。


已用时间:  00: 00: 00.73
zo_leave@orcl> set autotrace traceo


zo_leave@orcl> select * from scott.emp where deptno = '10';


已用时间:  00: 00: 00.10


执行计划
----------------------------------------------------------
Plan hash value: 3956160932


--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     3 |   261 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |     3 |   261 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------


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


   1 - filter("DEPTNO"=10)


Note
-----
   - dynamic sampling used for this statement




统计信息
----------------------------------------------------------
        522  recursive calls
          0  db block gets
         92  consistent gets
         18  physical reads
          0  redo size
        943  bytes sent via SQL*Net to client
        416  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          6  sorts (memory)
          0  sorts (disk)
          3  rows processed


-- 仅清空清除缓冲区缓存
zo_leave@orcl> set autotrace off
zo_leave@orcl> alter system set events 'immediate trace name flush_cache';


系统已更改。


已用时间:  00: 00: 10.56
zo_leave@orcl> set autotrace traceo
zo_leave@orcl> select * from scott.emp where deptno = '10';


已用时间:  00: 00: 00.03


执行计划
----------------------------------------------------------
Plan hash value: 3956160932


--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     3 |   261 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |     3 |   261 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------


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


   1 - filter("DEPTNO"=10)


Note
-----
   - dynamic sampling used for this statement




统计信息
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          8  consistent gets
          6  physical reads
          0  redo size
        943  bytes sent via SQL*Net to client
        416  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          3  rows processed


-- 不做任何处理
zo_leave@orcl> select * from scott.emp where deptno = '10';


已用时间:  00: 00: 00.00


执行计划
----------------------------------------------------------
Plan hash value: 3956160932


--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     3 |   261 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |     3 |   261 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------


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


   1 - filter("DEPTNO"=10)


Note
-----
   - dynamic sampling used for this statement




统计信息
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          8  consistent gets
          0  physical reads
          0  redo size
        943  bytes sent via SQL*Net to client
        416  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          3  rows processed




 


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

转载于:http://blog.itpub.net/26477854/viewspace-1072247/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值