ITPub博客

首页 > 数据库 > Oracle > 各种读取方式对CPU的消耗

各种读取方式对CPU的消耗

原创 Oracle 作者:wei-xh 时间:2015-09-06 13:06:09 0 删除 编辑
表大小 136 BLOCKS 17,408
cpu_time代表百万分之一秒

读取方式                                                CPU消耗
 in-memory  7999
 buffer cache      19997
 direct path read  46993
 db file scatterd read  133980


in-memory对cpu的消耗对比其他几种方式,CPU消耗最小

大体的测量方法:
@size
Enter value for segment_name: test
Enter value for owner: test
old   2: from dba_segments where segment_name=UPPER('&segment_name') and owner = upper('&owner') order by 1
new   2: from dba_segments where segment_name=UPPER('test') and owner = upper('test') order by 1

OWNER           SEGMENT_NAME                  PARTITION_NAME                 TABLESPACE_NAME                     SIZE_M       BLOCKS
--------------- ----------------------------- ------------------------------ ----------------------------- ------------ ------------
TEST            TEST                                                         USERS                                  136       17,408

表cache
alter table test cache;
select count(*)from test;

in-memory


test@WXHPDB1>select 27996 - 19997 from dual;

27996-19997
-----------
       7999


direct path read
清空buffer_cache,shared_pool
select count(*)from test;
想知道后台是什么等待事件,可以通过v$active_session_history  session_id;查询


db file scatterd read
调大_small_table_threshold,清空buffer_cache,shared_pool
select count(*)from test;



沃趣科技高级数据库专家、项目经理
TEL:18652489962
公司网站:http://www.woqutech.com
杭州市滨江区长河街道滨安路1190号3幢智汇领地科技园A区A楼10层1004室(310053)

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

上一篇: 修复OCR和VOTING
请登录后发表评论 登录
全部评论
Oracle ACE组成员,DBGeeK用户组发起人。曾在DTCC、ORACLE技术嘉年华、Gdevops等公开场合做过数据库技术专题分享,2017年应Oracle邀请在世界最大的数据库会议OOW上做技术分享。组织翻译了《拨云见日,解密Oracle ASM内核》一书。

注册时间:2009-07-04

  • 博文量
    422
  • 访问量
    2425322