14.8.3 Physical Row Structure of InnoDB Tables InnoDB 表的物理行结构
来源:互联网 发布:数据的宽度 编辑:程序博客网 时间:2024/05/29 10:35
14.8.3 Physical Row Structure of InnoDB Tables InnoDB 表的物理行结构一个InnoDB 表的物理行结构取决于在创建表指定的行格式默认, InnoDB 使用Antelope file format 和它的COMPACT 行格式。REDUNDANT format 是可用的来保持兼容性和MySQL 老的版本。当你启用 innodb_file_per_table setting, 你也可以使用新的Barracuda file format, 使用它的DYNAMIC and COMPRESSED row formats。检查InnoDB表的行格式,你可以使用SHOW TABLE STATUS. For example: mysql> SHOW TABLE STATUS IN test1\G*************************** 1. row *************************** Name: t1 Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 16384 Data_free: 0 Auto_increment: 1 Create_time: 2014-10-31 16:02:01 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment:你也可以检查InnoDB表的行格式通过查询INFORMATION_SCHEMA.INNODB_SYS_TABLES. mysql> SELECT NAME, ROW_FORMAT FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test1/t1';+----------+------------+| NAME | ROW_FORMAT |+----------+------------+| test1/t1 | Compact |+----------+------------+Redundant Row Format Characteristics 荣誉行格式特性:在InnoDB 表使用 REDUNDANT row format 有下面的特点:1. 每个index 记录包含一个6字节的header,header 是用于把连续的记录连接起来,也用于 row-level locking. 2.记录在 clustered index 包含字段用于所有用户定义的列,此外,有一个6个字节的 transaction ID field 和一个7个字节的指针字段3.如果一个表没有定义主键, 每个clustered index record 也包含一个6字节的row ID字段4.每个secondary index record 也包含所有的主键字段 定义用于clustered index key 5.一个记录包含一个支点到每个记录的字段,如果字段的总长度在一个记录是小于128字节,指针是1个字节否则 指针是2个字节。这些指针的数组被称为记录目录,这些指针指向区域被称为 记录的数据部分6. 在内部, InnoDB 存储固定长度的字符串列 比如CHAR(10) 以一个固定长度格式。InnoDB 不会截断VARCHAR列两侧的空格7.InnoDB 编码固定长度字段大于或者等于768字节 8.一个SQL NULL 值存储一个或者2个字节在记录目录。除此之外, 一个SQL NULL 值 存储0个字节在记录的数据部分 如果存储在可变成都列。在一个固定长度列,他存储列的固定长度在记录的数据部分。COMPACT Row Format Characteristics 紧凑的行格式COMPACT row format 降低了约20%的行存储空间相比 REDUNDANT format 增加了CPU 使用对于一些操作。如果你的负载时是典型的受限于cahce 命中率和磁盘速度, COMPACT format 是看起来更快的。如果你的负载是受限于CPU 速度,compact format 可能会更慢在InnoDB 表中使用COMPACT row format 有下面的特点:1. 每个index record 包含一个5个字节的header 通过一个可变长度的header ,header是用于把联系的记录连接起来,也用于row-level locking2. 记录header 是跟在非NULL列的数据内容的后面3.记录在 clustered index 包含字段用于所有用户定义的列,此外,有一个6字节的事务ID 字段和一个7字节的指针字段4. 如果表没有一个主键,每个clustered index record 也包含一个6字节的row id字段5.每个secondary index record 也包含所有的主键字段 定义用于clustered index key如果任何主键字段是可变长度, record header对于每个 secondary index有一个可变部分来记录它们的长度,即使 secondary index 是定义在可变长度列6.InnoDB 不截断去掉 VARCHAE列两侧的空格
0 0
- 14.8.3 Physical Row Structure of InnoDB Tables InnoDB 表的物理行结构
- 14.8.11 Physical Structure of an InnoDB Index InnoDB Index 的物理结构
- 14.2.5.4 Physical Structure of an InnoDB Index InnoDB Index 的物理结构
- 14.2.6.4 Physical Structure of an InnoDB Index InnoDB Index 物理结构
- mysql 索引页物理结构--physical structer of an innodb index
- 14.8.2.2 InnoDB索引的物理结构
- 14.2.5.7 Physical Row Structure 物理数据结构:
- 14.8.2 Role of the .frm File for InnoDB Tables InnoDB 表得到 .frm文件的作用
- 14.8.1 Overview of InnoDB Row Storage
- Innodb 索引结构了解 - Innodb Index Structure
- myisam、innodb物理结构
- Innodb表的物理存储结构及特性
- InnoDB 的表结构
- 14.5.7 Limits on InnoDB Tables InnoDB 表的限制
- 14.6.7?Limits on InnoDB Tables InnoDB 表的限制
- 14.8.1 Creating InnoDB Tables 创建InnoDB 表
- InnoDB INDEX页物理结构
- 14.2.5.1 Role of the .frm File for InnoDB Tables InnoDB .frm文件的作用
- HDU 1058 Humble Numbers 【暴力(DFS)】
- 投入OJ的怀抱~~~
- android developer tiny share-20161101
- 【原创】枚举枚上天,暴力出奇迹(韩信点兵、分钱游戏、硬币面值组合)
- 第十一周—C语言 oj上机题目(趣味小数)
- 14.8.3 Physical Row Structure of InnoDB Tables InnoDB 表的物理行结构
- 关于php从数据库导出到excel中
- ping命令--Linux命令应用大词典729个命令解读
- js实现全选(全部取消)反向选择
- CSS3 Media Queries 与Responsive 设计
- Arraylist中的modCount 的作用
- Android经典Demo
- hive中的虚拟列
- 数据建模