XtraDB/InnoDB file format (submitted to the MariaDB official Manual), xtradbmariadb
This document is the translation of the mariadb official manual: XtraDB/InnoDB File Format.
Original article: https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
Https://mariadb.com/kb/zh-cn/xtradbinnodb-file-format/ I submitted to the MariaDB official manual
Currently, XtraDB/InnoDB supports two storage formats: Antelope and Barracuda, 26 file formats are also mentioned at the end of this article, all of which are named by animal names ). You can use server Variablesinnodb_file_format
Set the file format. The default value is Antelope. The file format between MySQL 5.5.0 and 5.5.6 is Barracuda by default, but this format may cause replication problems in some cases during upgrade, therefore, in MariaDB, the default format is always set to Antelope.
The system tablespace uses the Antelope file format and cannot be changed. To enable the user table to use the Barracuda format, you need to set the variableinnodb_file_per_table
.
MariaDB starting with 10.0
From MariaDB 10.0, you can view the file format in the Information Schema INNODB_SYS_TABLES table.
Compatibility
Each tablespace is marked with the file format id of the recently used table. All versions of XtraDB/InnoDB can read tables in older file formats. However, tables in the updated format cannot be read. For this reason, each time XtraDB/InnoDB opens a table, it checks the format of the space and reports an error when a new file format is used.
(Original article: Each tablespace is tagged with the id of the most recent file format used by one of its tables. all versions of XtraDB/InnoDB can read tables that use an older file format. however, it can not read from more recent formats. for this reason, each time XtraDB/InnoDB opens a table it checks the tablespace's format, and returns an error if a newer format is used .)
You can set variablesinnodb_file_format_check
To skip the check. However, when an unknown format is found, XtraDB/InnoDB tries to repair the table and damage the table. This will happen when it is disabled.innodb_file_format_check
When the server crashes or the service is quickly shutdown.
To downgrade from the Barracuda format to the Antelope format, you can useALTER TABLE
StatementROW_FORMAT
Is a value that supports Antelope. This reconstructs the index.
Antelope tables can work normally on MariaDB and MySQL versions earlier than 5.5.
Note that the tablespace is marked as the lowest file format that supports the row format used. Therefore, even if Barracuda is enabled, if the row format is Compact or Redundant, the table format is marked as Antelope.
Antelope
Antelope is the original file format of InnoDB. It supports the COMPACT and REDUNDANT row formats, but does not support dynamic or compressed row formats.
Barracuda
Barracuda is an updated InnoDB file format that supports the COMPACT, REDUNDANT, DYNAMIC, and COMPRESSED row formats. Tables with BLOB or TEXT data types can greatly benefit from the dynamic row format.
Future format
In the future, XtraDB/InnoDB may use a new file format. Each format has its own name, and its id ranges from 0 to 25. These names are all determined by the alphabetic order: Antelope, Barracuda, Cheetah, Dragon, Elk, Fox, Gazelle, Hornet, Impala, jaruar, Kangaroo, Leopard, moose, Nautilus, Ocelot, Porpoise, Quail, Rabbit, Shark, Tiger, Urchin, Viper, Whale, Xenops, Yak and Zebra.
Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to website architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.html
Back to database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.html
Reprinted please indicate the source: http://www.cnblogs.com/f-ck-need-u/p/8613039.html
Note: If you think this article is not bad, please click the recommendation in the lower right corner. Your support can stimulate the author's enthusiasm for writing. Thank you very much!