12
返回列表 发新帖
楼主: tracyku

大量逻辑读会影响数据库性能么

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2016-12-8 23:52 | 只看该作者
A logical read literally is indeed a read from a buffer in the buffer cache:
http://docs.oracle.com/database/122/CNCPT/glossary.htm#CNCPT94718
"logical read
A read of a buffer in the database buffer cache."

But in practice, as in calculating statistics, the count of logical reads includes the number of normal physical reads. (In most contexts, this physical read refers to the number of blocks, not the number of times of reading, from the datafile. The two values may differ because of multiblock reads.) This is because if Oracle doesn't find a block in the buffer cache, it copies the block from the datafile into buffer cache and then reads it. My earlier statement "Logical reads are sum of buffer cache reads and physical reads, not just buffer cache reads." posted in 2014 was not clear about this, or can be considered misleading. It's only correct when interpreted as saying, e.g. "Out of 1000 logical reads of this table, 800 are directly from buffer cache and 200 are from the datafile first, followed by reading (i.e. actually examining the contents of) these 200 memory buffers."

Tom Kyte said
https://asktom.oracle.com/pls/as ... ON_ID:6643159615303
"LIO = logical = buffer cache. LIO *may* have incurred a PIO in order to get into the cache in the first place. "
That's exactly what I meant. Later in the thread, we see him say
--- begin quote ---
If I ask a query like:
select * from emp where empno = :x
I would expect 3 logical IOs for the index and one for the table. I would expect 4 logical IO's
--- end quote ---
I don't think he was making a distinction between buffer cache read and physical read when he says 3 or 4 "logical IOs" here.

Also, according to
https://docs.oracle.com/cd/E2462 ... abase.htm#EMDBM1534
"The data [for calculating Buffer Cache Hit (%)] is derived from the ((DeltaLogicalGets - (DeltaPhysicalReads - DeltaPhysicalReadsDirect)) / DeltaLogicalGets) * 100 formula"
We see that the word "logical" includes "physical", at least in the phrase "logical get" as compared to "physical get". If "logical" and "physical" were mutually exclusive in this formula, logical gets minus physical gets would make no sense.

使用道具 举报

回复
论坛徽章:
49
NBA季后赛之星
日期:2014-10-19 19:51:33蓝锆石
日期:2014-10-19 19:51:33指数菠菜纪念章
日期:2014-10-19 19:52:33指数菠菜纪念章
日期:2014-10-19 19:52:33指数菠菜纪念章
日期:2014-10-19 19:52:33指数菠菜纪念章
日期:2014-10-19 19:52:33问答徽章
日期:2014-04-15 10:41:44优秀写手
日期:2014-07-24 06:00:11保时捷
日期:2014-10-19 19:51:33三菱
日期:2014-10-19 19:51:33
12#
发表于 2017-3-1 12:03 | 只看该作者
首先,不管逻辑读还是物理读,多了都不好。
逻辑读多通常反应为cpu负载高、物理读多io会忙。

YongHuang说的那些,我觉得是在创新概念。
逻辑读要么理解为一致性读+当前模式读,一般意义上的就是buffercache读也没有问题。

使用道具 举报

回复
论坛徽章:
0
13#
发表于 2017-4-8 17:18 | 只看该作者
学习了,我也一直以为逻辑读就是buffer读。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表