MySQL中的Rows,Row_format以及MyISAM和InnoDB的一点区别
2016-09-06 10:10
555 查看
转自:http://blog.csdn.net/xiaotengyi2012/article/details/19368979前面说到的count(*)的数字MyISAM是存储在一个地方就是表的Rows中,从下面的话中我们可以看出MyISAM存的是一个准确的数字,而InnoDB则存储的是粗略的数字。RowsThe number of rows in the table. For nontransactional tables, this number isalways accurate. For transactional tables, it is usually an estimate.--------------------------------------------------------朴实的分割线----------------------------------------------------------------------------------Row_formatThe row format. For a MyISAM table, this can be Dynamic, Fixed,or Compressed.Dynamic rows vary in length because they contain variable-length fields such asVARCHAR or BLOB. Fixed rows, which are always the same size, are made up offields that don’t vary in length, such as CHAR and INTEGER. Compressed rows existonly in compressed tables.MyISAM是可以修改row_format的,
of MySQL earlier than 5.0.3,
even for fixed-size columns. By default, tables are created in the compact format (
older versions of MySQL, you can request the old format with
rare case that is limited by CPU speed, it might be slower.The compact
containing UTF-8 data are stored. With
3 ×
Many languages can be written primarily using single-byte UTF-8 characters, so a fixed storage length often wastes space. With
a variable amount of storage in the range from
for these columns by stripping trailing spaces if necessary. The minimum storage length is kept as
to facilitate in-place updates in typical cases.其实
InnoDB
测试了一下不行,都是
Default
的
COMPACT
。下面的内容摘自MySQL官网,解释了
COMPACT
和
REDUNDANT的区别。http://dev.mysql.com/doc/refman/5.1/en/data-size.html
InnoDBtables use a compact storage format. In versions
of MySQL earlier than 5.0.3,
InnoDBrows contain some redundant information, such as the number of columns and the length of each column,
even for fixed-size columns. By default, tables are created in the compact format (
ROW_FORMAT=COMPACT). If you wish to downgrade to
older versions of MySQL, you can request the old format with
ROW_FORMAT=REDUNDANT.The presence of the compact row format decreases row storage space by about 20% at the cost of increasing CPU use for some operations. If your workload is a typical one that is limited by cache hit rates and disk speed it is likely to be faster. If it is a
rare case that is limited by CPU speed, it might be slower.The compact
InnoDBformat also changes how
CHARcolumns
containing UTF-8 data are stored. With
ROW_FORMAT=REDUNDANT, a UTF-8
CHAR(N)occupies
3 ×
Nbytes, given that the maximum length of a UTF-8 encoded character is three bytes.
Many languages can be written primarily using single-byte UTF-8 characters, so a fixed storage length often wastes space. With
ROW_FORMAT=COMPACTformat,
InnoDBallocates
a variable amount of storage in the range from
Nto 3 ×
Nbytes
for these columns by stripping trailing spaces if necessary. The minimum storage length is kept as
Nbytes
to facilitate in-place updates in typical cases.其实
REDUNDANT
相当于固长,有冗余。
COMPACT
更灵活,更紧凑。转自:http://www.cnblogs.com/isql/archive/2009/12/17/Row_format.html
相关文章推荐
- MySQL中的Rows,Row_format以及MyISAM和InnoDB的一点区别
- MySQL中的Rows,Row_format以及MyISAM和InnoDB的一点区别
- MySQL Row size too large (> 8126) 以及ROW_FORMAT=COMPRESSED requires innodb_file_format > Antel 的解决办法
- MYisam和InnoDB区别以及MySQL引擎简介
- MySql中启用InnoDB数据引擎简介 以及 InnoDB与 MYISAM的区别和联系
- MYisam和InnoDB区别以及MySQL引擎简介
- mysql数据据存储引擎InnoDB和MyISAM的优势及区别
- mysql数据据存储引擎InnoDB和MyISAM的优势及区别
- mysql myisam innodb 区别
- mysql innodb 和myisam的区别
- mysql中engine=innodb和engine=myisam的区别
- mysql myisam innodb 区别
- MySQL: MyISAM和InnoDB的区别
- mysql中MyISAM和InnoDB的区别
- mysql myisam innodb 区别
- mysql数据据存储引擎InnoDB和MyISAM的优势及区别
- mysql学习笔记 ----外键.myisam和innodb的区别
- Mysql innodb引擎和myisam引擎 使用索引区别
- mysqli和mysql以及fetch_row和fetch_array的区别
- mysql存储引擎:InnoDB和MyISAM的区别与优劣