4.2. Named File Formats

The InnoDB Plugin introduces the idea of a named file format and a configuration parameter to enable the use of features that require use of that format. The new file format is the Barracuda format, and the file format supported by prior releases of InnoDB is known as Antelope. Compressed tables and the new row format that stores long columns off-page require the use of the Barracuda file format or newer. Future versions of InnoDB may introduce a series of file formats, identified with the names of animals, in ascending alphabetic order.

Beginning with this release, every InnoDB per-table tablespace file is labeled with a file format identifier. This does not apply to the system tablespace (the ibdata files) but only the files of separate tablespaces (the *.ibd files where tables and indexes are stored in their own tablespace). As noted below, however, the system tablespace is tagged with the highest file format in use in a group of InnoDB database files, and this tag is checked when the files are opened.

In this release, when you create a compressed table, or a table with ROW_FORMAT=DYNAMIC, the file header for the corresponding .ibd file and the table type in the InnoDB data dictionary are updated with the identifier for the Barracuda file format. From that point forward, the table cannot be used with a version of InnoDB that does not support this new file format. To protect against anomalous behavior, InnoDB version 5.0.21 and later performs a compatibility check when the table is opened, as described below. (Note that the ALTER TABLE command in many cases, causes a table to be recreated and thereby change its properties. The special case of adding or dropping indexes without rebuilding the table is described in Chapter 2, Fast Index Creation in the InnoDB Storage Engine.)

If a version of InnoDB supports a particular file format (whether or not it is enabled), you can access and even update any table that requires that format or an earlier format. Only the creation of new tables using new features is limited based on the particular file format enabled. Conversely, if a tablespace contains a table or index that uses a file format that is not supported by the currently running software, it cannot be accessed at all, even for read access.

The only way to downgrade an InnoDB tablespace to an earlier file format is to copy the data to a new table, in a tablespace that uses the earlier format. This can be done with the ALTER TABLE command, as described in Section 4.6, “Downgrading the File Format”.

The easiest way to determine the file format of an existing InnoDB tablespace is to examine the properties of the table it contains, using the SHOW TABLE STATUS command or querying the table INFORMATION_SCHEMA.TABLES. If the Row_format of the table is reported as 'Compressed' or 'Dynamic', the tablespace containing the table uses the Barracuda format. Otherwise, it uses the prior InnoDB file format, Antelope.

User Comments
Sign Up Login You must be logged in to post a comment.