楼主: grassbell

[精华] 偷窥Data block 的物理结构

[复制链接]
论坛徽章:
5
2009新春纪念徽章
日期:2009-01-04 14:52:28授权会员
日期:2009-01-17 15:10:222009日食纪念
日期:2009-07-22 09:30:002011新春纪念徽章
日期:2011-02-18 11:43:33ITPUB元老
日期:2012-08-14 18:34:13
91#
发表于 2009-4-7 15:24 | 只看该作者
frre=-1
fsbo=0x14                ==> free space begin offset
fseo=0x1f9b              ==> free space end offset
avsp=0x1f83              ==> available space in the block
tosp=0x1f83              ==> total available space when all transactions commit

怎么去理解这几个参数。我对这里的offset总觉得不清楚。是以什么地方做为计算的起始点?

fsbo = hsiz?
frre 似乎都是-1。

使用道具 举报

回复
论坛徽章:
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
92#
发表于 2009-4-8 03:17 | 只看该作者
原帖由 venee_lee 于 2009-4-7 01:24 发表
fsbo=0x14                ==> free space begin offset
fseo=0x1f9b              ==> free space end offset
...
怎么去理解这几个参数。我对这里的offset总觉得不清楚。是以什么地方做为计算的起始点?


If I remember right, the starting position is still the beginning of the block. So the block looks like this (assuming 8192 i.e. x2000 block size):

1 start 0 ----------
2 fsbo x14 ---------
3 fseo x1f9b ---------
4 end x2000 ---------

Data is in [3-4]. If there's new data coming in now, it's at 3 going toward 2. Block header is in [1-2].

I could remember wrong. Need to refresh my memory.

Yong Huang

使用道具 举报

回复
论坛徽章:
5
2009新春纪念徽章
日期:2009-01-04 14:52:28授权会员
日期:2009-01-17 15:10:222009日食纪念
日期:2009-07-22 09:30:002011新春纪念徽章
日期:2011-02-18 11:43:33ITPUB元老
日期:2012-08-14 18:34:13
93#
发表于 2009-4-8 08:46 | 只看该作者
原帖由 Yong Huang 于 2009-4-8 03:17 发表


If I remember right, the starting position is still the beginning of the block. So the block looks like this (assuming 8192 i.e. x2000 block size):

1 start 0 ----------
2 fsbo x14 ---------
3 fseo x1f9b ---------
4 end x2000 ---------

Data is in [3-4]. If there's new data coming in now, it's at 3 going toward 2. Block header is in [1-2].

I could remember wrong. Need to refresh my memory.

Yong Huang


和我的理解差不多!
1   fsbo=0x14
2   fseo=0x1f9b
3   avsp=0x1f83
4   tosp=0x1f83
-------------------------------------------------------------
1                                         2@@@@@@@@@@
@ 区域是已用空间
1:可用空间的起始位置
2:可用空间的终点位置
  2之后的是已用位置
1-2之间就是可用空间
fseo-fsbo=0x1f9b-0x14=0x1f87
可块头上记录的是avsp=0x1f83
这4个字节被哪里占用了,还是我计算方法有问题。

可否断定:数据的存储是从块的底部开始的?

[ 本帖最后由 venee_lee 于 2009-4-8 08:59 编辑 ]

使用道具 举报

回复
论坛徽章:
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
94#
发表于 2009-4-8 09:33 | 只看该作者
Indeed, data comes in from the bottom of the block. I don't know how to explain the missing 4 bytes. Is it related to delayed block cleanout? Can you make sure to use a query (SELECT statement) to read this block and dump again? What was the recent operation on this block, delete, insert, or update?

I'll keep this in mind. But I don't have an answer for now.

Yong Huang

[ 本帖最后由 Yong Huang 于 2009-4-8 13:47 编辑 ]

使用道具 举报

回复
论坛徽章:
5
2009新春纪念徽章
日期:2009-01-04 14:52:28授权会员
日期:2009-01-17 15:10:222009日食纪念
日期:2009-07-22 09:30:002011新春纪念徽章
日期:2011-02-18 11:43:33ITPUB元老
日期:2012-08-14 18:34:13
95#
发表于 2009-4-8 11:18 | 只看该作者
原帖由 Yong Huang 于 2009-4-8 09:33 发表
Indeed, data comes in from the bottom of the block. I don't know how to explain the missing 4 bytes. Is it related to delayed blocked cleanout? Can you make sure to use a query (SELECT statement) to read this block and dump again? What was the recent operation on this block, delete, insert, or update?

I'll keep this in mind. But I don't have an answer for now.

Yong Huang


上面贴出来的是楼主的数据。

我在自己的库上做过两次测试,两个不同的表。
过程
insert 一次
commit

两次的结果还不一样,其中的一次正好,另外一次也少4个byte。弄不懂了!

使用道具 举报

回复
论坛徽章:
42
ITPUB北京香山2007年会纪念徽章
日期:2007-01-24 14:35:022011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:56管理团队成员
日期:2011-05-07 01:45:08ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:23
96#
发表于 2009-4-9 21:32 | 只看该作者
可以看看row header那儿有没有浪费的, 删除4条记录,然后再删除中间的两条试试.

使用道具 举报

回复
论坛徽章:
0
97#
发表于 2009-5-22 17:35 | 只看该作者
'所以,一个block中最多包括 db_block_size/11 条rows'

是不是应该这样算:
(db_block_size-90)/11 条rows

使用道具 举报

回复
论坛徽章:
176
现任管理团队成员
日期:2011-05-07 01:45:08版主7段
日期:2012-07-05 02:21:03ITPUB长老会成员
日期:2015-05-07 15:11:10ITPUB年度最佳版主
日期:2011-04-08 18:37:09ITPUB年度最佳版主
日期:2011-12-28 15:24:18ITPUB牛人
日期:2010-10-25 12:41:322010数据库技术大会纪念徽章
日期:2015-04-23 10:33:192011数据库大会纪念章
日期:2015-04-23 10:33:192012数据库大会纪念章
日期:2015-04-23 10:33:192013数据库大会纪念章
日期:2015-04-23 10:33:19
98#
发表于 2009-6-26 14:29 | 只看该作者
看看精华帖学习中!

使用道具 举报

回复
论坛徽章:
27
奥运会纪念徽章:花样游泳
日期:2008-08-12 10:14:22奥运会纪念徽章:跳水
日期:2012-08-09 21:18:462012新春纪念徽章
日期:2012-01-04 11:54:26蛋疼蛋
日期:2011-07-03 12:15:012011新春纪念徽章
日期:2011-02-18 11:43:322011新春纪念徽章
日期:2011-01-04 10:35:17ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212010年世界杯参赛球队:巴拉圭
日期:2010-04-12 10:45:252010新春纪念徽章
日期:2010-03-01 11:19:502010新春纪念徽章
日期:2010-01-04 08:33:08
99#
发表于 2009-10-17 14:20 | 只看该作者
mark

使用道具 举报

回复
论坛徽章:
5
奥运会纪念徽章:帆船
日期:2012-08-12 09:19:55奥运会纪念徽章:帆船
日期:2012-08-14 11:20:42ITPUB 11周年纪念徽章
日期:2012-10-09 18:14:48
100#
发表于 2009-10-17 18:03 | 只看该作者
mark

使用道具 举报

回复

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

本版积分规则 发表回复

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