mysql源码阅读笔记 (1) 底层物理页面的数据结构
来源:互联网 发布:程序员发展前景 编辑:程序博客网 时间:2024/06/05 20:03
Innodb数据页结构
单个页面的数据结构如下图所示:
1.1 文件头(fil0fil.h)
/** The byte offsets on a file page for various variables @{ */#define FIL_PAGE_SPACE_OR_CHKSUM 0 /*!< in < MySQL-4.0.14 space id the page belongs to (== 0) but in later versions the 'new' checksum of the page */#define FIL_PAGE_OFFSET 4 /*!< page offset inside space */#define FIL_PAGE_PREV 8 /*!< if there is a 'natural' predecessor of the page, its offset. Otherwise FIL_NULL. This field is not set on BLOB pages, which are stored as a singly-linked list. See also FIL_PAGE_NEXT. */#define FIL_PAGE_NEXT 12 /*!< if there is a 'natural' successor of the page, its offset. Otherwise FIL_NULL. B-tree index pages (FIL_PAGE_TYPE contains FIL_PAGE_INDEX) on the same PAGE_LEVEL are maintained as a doubly linked list via FIL_PAGE_PREV and FIL_PAGE_NEXT in the collation order of the smallest user record on each page. */#define FIL_PAGE_LSN 16 /*!< lsn of the end of the newest modification log record to the page */#define FIL_PAGE_TYPE 24 /*!< file page type: FIL_PAGE_INDEX,..., 2 bytes. The contents of this field can only be trusted in the following case: if the page is an uncompressed B-tree index page, then it is guaranteed that the value is FIL_PAGE_INDEX. The opposite does not hold. In tablespaces created by MySQL/InnoDB 5.1.7 or later, the contents of this field is valid for all uncompressed pages. */#define FIL_PAGE_FILE_FLUSH_LSN 26 /*!< this is only defined for the first page in a system tablespace data file (ibdata*, not *.ibd): the file has been flushed to disk at least up to this lsn */#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this contains the space id of the page */#define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
各个字段的说明:
(Log Sequence Number) FIL_PAGE_TYPE 2 页的类型 FIL_PAGE_FILE_FLUSH_LSN 8 代表文件至少被更新到了改LSN FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 4 version > 4.1开始,代表该页属于哪个表空间
0 0
- mysql源码阅读笔记 (1) 底层物理页面的数据结构
- skynet底层源码阅读(1)
- PHP源码阅读 Day.2 解读PHP底层 mysql的驱动链接
- 数据结构之重写ArrayList的底层源码
- mysql源码阅读笔记-mysql 同步机制
- ArrayList增删底层源码阅读
- MySQL索引底层数据结构
- MySQL底层索引数据结构
- Tomcat源码阅读之底层IO封装(1)InternalNioInputBuffer的分析
- ConcurrentHashMap源码阅读以及底层实现的简单分析
- MySQL源码阅读笔记之代码结构
- mysql源码阅读笔记- 重做日志
- mysql 源码入门阅读调试笔记.
- x264源码阅读笔记1
- ActiveAndroid 源码阅读笔记 (1)
- ViewFlow 源码阅读笔记(1)
- flashsim源码阅读笔记1
- java 数据结构. 源码阅读
- SharePoint JS Link 之(四)JSlink常见例子和代码下载
- 关于@override报错的问题
- Web_PHP_DedeCMS_字段替换模块;
- IPVS基于应用层任意偏移字段HASH值的负载均衡算法
- Android自动化测试之UIAutomator
- mysql源码阅读笔记 (1) 底层物理页面的数据结构
- 文件读写两种方式
- Android为整个应用切换第三方字体
- Opencv中.xml和.yml读写
- javascript对象详述
- Web_JavaScript_头部隐现模块;
- MIME(Multipurpose Internet Mail Extension,多用途Internet邮件扩展)协议
- 解决unicodedecodeerror ascii codec can’t decode byte 0xd7 in position 9 ordinal not in range(128)
- Unity3D ParticleSystem粒子系统(3.5版)