楼主: cwjl11

逻辑读,当前读,一致读,和物理读

[复制链接]
论坛徽章:
13
数据库板块每日发贴之星
日期:2007-09-20 01:04:22铁扇公主
日期:2012-02-21 15:02:402010新春纪念徽章
日期:2010-03-01 11:08:28月度精华徽章
日期:2009-04-01 02:15:18数据库板块每日发贴之星
日期:2008-05-17 01:02:08生肖徽章2007版:兔
日期:2008-04-07 19:49:48生肖徽章2007版:鼠
日期:2008-01-02 17:35:53生肖徽章2007版:鸡
日期:2008-01-02 17:35:53ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44数据库板块每日发贴之星
日期:2007-10-20 01:03:31
11#
发表于 2010-8-19 14:05 | 只看该作者
对内,共匪什么都要,就是不要脸;对外,共匪什么都不要,就是要脸。

使用道具 举报

回复
论坛徽章:
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
12#
发表于 2010-8-20 03:30 | 只看该作者
原帖由 bottawa 于 2010-8-3 19:52 发表
In  Chapter 2, When Jonathan explains v$segstat, the result of the statistics shows more physical reads than logical reads. His explanation is 1) the logical reads statistic is sampled, especially since his use of the object had been a little extreme.  or 2) the sample clause used by the dbms_stats when estimating statistics on a table can result in a variant of the tablescan run-time mechanism that literally does report more physical I/Os than logical I/Os.


Thanks. But that only applies to the numbers in the view v$segstat or v$segment_statistics, not anywhere else.

According to v$segstat_name and further "Bug" 3771746, logical reads in those two views are sampled. I just checked 11gR2. They still are.

Yong Huang

使用道具 举报

回复
论坛徽章:
13
数据库板块每日发贴之星
日期:2010-08-24 01:01:012012新春纪念徽章
日期:2012-01-04 11:57:13ITPUB十周年纪念徽章
日期:2011-11-01 16:25:51数据库板块每日发贴之星
日期:2011-07-11 01:01:01ITPUB伯乐
日期:2011-06-16 10:11:39ITPUB季度 技术新星
日期:2011-01-17 11:30:46授权会员
日期:2010-12-28 19:29:32ITPUB9周年纪念徽章
日期:2010-10-08 09:28:51数据库板块每日发贴之星
日期:2010-09-07 01:01:01数据库板块每日发贴之星
日期:2010-08-28 01:01:01
13#
发表于 2010-8-26 21:33 | 只看该作者
关于一致性读(consistent gets)的问题,我前些天还上网看了:

consistent gets:一致性读,为了保持读一致性而获取的块,其中可能包括undo block,也有包括非undo block,而非undo block有有可能包括 buffer cache block ,也有可能包括 disk block。
consistent gets可以简单的理解为,最终的结果集,所获取的块数。

db block gets:其实这个名字可能有点歧义,这个表示 no consistent gets,即非一致性读,
也就是说,一条查询语句发出后,所读的块中,除了consistent gets,就是db block gets,
所以才会有:consistent gets + db block gets = Logical IO 的说法。

physical reads:这个就更好理解了,物理读,就是从磁盘中读取出的 block 数目,这个参数大家的理解都没什么问题。
所以: physical reads =physical IO。

使用道具 举报

回复
论坛徽章:
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
14#
发表于 2010-8-27 02:29 | 只看该作者
> physical reads:这个就更好理解了,物理读,就是从磁盘中读取出的 block 数目,这个参数大家的理解都没什么问题。
> 所以: physical reads =physical IO。

One complication with physical reads is that you can't say it's "读取出的 block 数目" in all cases. In most cases, it's the number of blocks that are read, not number of times of physical read; they differ when there's multiblock read. See
http://yong321.freeshell.org/computer/diskreadunit.txt However, the plain English of "physical reads" should really mean number of times of physical read, which is the meaning v$filestat and v$tempstat or non-Oracle tools such as iostat correctly use.

Yong Huang

[ 本帖最后由 Yong Huang 于 2010-8-29 17:42 编辑 ]

使用道具 举报

回复
论坛徽章:
0
15#
发表于 2010-8-28 20:15 | 只看该作者
原帖由 Yong Huang 于 2010-8-27 02:29 发表
> physical reads:这个就更好理解了,物理读,就是从磁盘中读取出的 block 数目,这个参数大家的理解都没什么问题。
> 所以: physical reads =physical IO。

One complication with physical reads is that you can't say it's "读取出的 block 数目" in all cases. In most cases, it's actually the number of times of read, not blocks that have been read, unless you guarantee there's no multiblock read. See
http://yong321.freeshell.org/computer/diskreadunit.txt

Yong Huang



我非常想了解下您引经据典的办法。有很多知识在文档上见过,回头会找不到在哪见过,事后想翻阅的事后常常没有方向。

想请教下您的经验,是怎么做到的?是靠勤做笔记吗?

使用道具 举报

回复
论坛徽章:
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
16#
发表于 2010-8-29 03:43 | 只看该作者
原帖由 aktt12 于 2010-8-28 06:15 发表

我非常想了解下您引经据典的办法。有很多知识在文档上见过,回头会找不到在哪见过,事后想翻阅的事后常常没有方向。

想请教下您的经验,是怎么做到的?是靠勤做笔记吗?


Yes, I make notes a lot, all electronically. I save important messages in a text or html file on my local hard drive, occasionally save a PDF file. If I have some thoughts, I either write and save it to a file locally, or if it's mature enough I post it to my own web site. Both are searchable. Locally, I use Google Desktop Search. In the past I tried Copernic and Microsoft Desktop Search. All have their own problems. Without desktop search, my study can't be that efficient.

However, nothing beats a human brain. Some of the things are too difficult to search because there's no clear keyword to use. You just have to remember them.

Yong Huang

使用道具 举报

回复
论坛徽章:
1682
九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-27 15:37:10九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-19 11:12:55九尾狐狸
日期:2012-09-19 11:12:55玉石琵琶
日期:2014-06-26 16:52:29玉石琵琶
日期:2014-06-26 16:52:29
17#
发表于 2010-8-29 17:55 | 只看该作者
学习了,Yong版主有耐心回答的也很好啊,3Q。。。

使用道具 举报

回复
论坛徽章:
13
数据库板块每日发贴之星
日期:2010-08-24 01:01:012012新春纪念徽章
日期:2012-01-04 11:57:13ITPUB十周年纪念徽章
日期:2011-11-01 16:25:51数据库板块每日发贴之星
日期:2011-07-11 01:01:01ITPUB伯乐
日期:2011-06-16 10:11:39ITPUB季度 技术新星
日期:2011-01-17 11:30:46授权会员
日期:2010-12-28 19:29:32ITPUB9周年纪念徽章
日期:2010-10-08 09:28:51数据库板块每日发贴之星
日期:2010-09-07 01:01:01数据库板块每日发贴之星
日期:2010-08-28 01:01:01
18#
发表于 2010-8-29 23:15 | 只看该作者
原帖由 Yong Huang 于 2010-8-27 02:29 发表
> physical reads:这个就更好理解了,物理读,就是从磁盘中读取出的 block 数目,这个参数大家的理解都没什么问题。
> 所以: physical reads =physical IO。

One complication with physical reads is that you can't say it's "读取出的 block 数目" in all cases. In most cases, it's actually the number of times of read, not blocks that have been read, unless you guarantee there's no multiblock read. See
http://yong321.freeshell.org/computer/diskreadunit.txt

Yong Huang


I don't think so. Here is the statement from the goverment document:

physical reads:
Total number of data blocks read from disk. This value can be greater than the value of "physical reads direct" plus "physical reads cache" as reads into process private buffers also included in this statistic.

So  I think "physical reads" is the number of blocks, not the read time of the blocks.

使用道具 举报

回复
论坛徽章:
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
19#
发表于 2010-8-30 07:30 | 只看该作者
原帖由 红叶DBA 于 2010-8-29 09:15 发表

I don't think so. Here is the statement from the goverment document:

physical reads:
Total number of data blocks read from disk. This value can be greater than the value of "physical reads direct" plus "physical reads cache" as reads into process private buffers also included in this statistic.

So  I think "physical reads" is the number of blocks, not the read time of the blocks.


I made a mistake in my last message (#14). My note
http://yong321.freeshell.org/computer/diskreadunit.txt
really proves that in the case of v$sql(area) and tkprof, "physical reads" refers to number of blocks, not number of times of read. I simply remembered backward. I made the change in my msg #14. Please read it.

The statistic "physical reads" is clearly defined in Reference manual as number of blocks, so people won't blame Oracle, except for its misleading use of the English phrase.

Yong Huang

[ 本帖最后由 Yong Huang 于 2010-8-29 17:45 编辑 ]

使用道具 举报

回复
论坛徽章:
86
2015中国数据库技术大会纪念徽章
日期:2015-04-24 16:04:24马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11优秀写手
日期:2013-12-18 09:29:11日产
日期:2013-10-17 08:44:39马自达
日期:2013-08-26 16:28:022013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-23 16:55:51马上有房
日期:2014-02-19 11:55:14
20#
发表于 2010-8-30 08:35 | 只看该作者
原帖由 Yong Huang 于 2010-8-29 03:43 发表


Yes, I make notes a lot, all electronically. I save important messages in a text or html file on my local hard drive, occasionally save a PDF file. If I have some thoughts, I either write and save it to a file locally, or if it's mature enough I post it to my own web site. Both are searchable. Locally, I use Google Desktop Search. In the past I tried Copernic and Microsoft Desktop Search. All have their own problems. Without desktop search, my study can't be that efficient.

However, nothing beats a human brain. Some of the things are too difficult to search because there's no clear keyword to use. You just have to remember them.

Yong Huang


有没有好的文档管理软件推荐?

使用道具 举报

回复

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

本版积分规则 发表回复

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