14.6 Serialized Dictionary Information (SDI)序列化字典信息(SDI)

In addition to storing metadata about database objects in the data dictionary, MySQL stores it in serialized form. 除了在数据字典中存储关于数据库对象的元数据外,MySQL还以序列化形式存储它。This data is referred to as serialized dictionary information (SDI). 此数据称为序列化字典信息(SDI)。InnoDB stores SDI data within its tablespace files. InnoDB将SDI数据存储在其表空间文件中。NDBCLUSTER stores SDI data in the NDB dictionary. NDBCLUSTER将SDI数据存储在NDB字典中。Other storage engines store SDI data in .sdi files that are created for a given table in the table's database directory. 其他存储引擎在为表的数据库目录中的给定表创建的.sdi文件中存储SDI数据。SDI data is generated in a compact JSON format.SDI数据以紧凑的JSON格式生成。

Serialized dictionary information (SDI) is present in all InnoDB tablespace files except for temporary tablespace and undo tablespace files. 序列化字典信息(SDI)存在于所有InnoDB表空间文件中,但临时表空间和撤消表空间文件除外。SDI records in an InnoDB tablespace file only describe table and tablespace objects contained within the tablespace.InnoDB表空间文件中的SDI记录仅描述表空间中包含的表和表空间对象。

SDI data is updated by DDL operations on a table or CHECK TABLE FOR UPGRADE. SDI数据通过表上的DDL操作或者说通过表或CHECK TABLE FOR UPGRADE进行更新。SDI data is not updated when the MySQL server is upgraded to a new release or version.当MySQL服务器升级到新版本或版本时,SDI数据不会更新。

The presence of SDI data provides metadata redundancy. SDI数据的存在提供了元数据冗余。For example, if the data dictionary becomes unavailable, object metadata can be extracted directly from InnoDB tablespace files using the ibd2sdi tool.例如,如果数据字典变得不可用,则可以使用ibd2sdi工具直接从InnoDB表空间文件提取对象元数据。

For InnoDB, an SDI record requires a single index page, which is 16KB in size by default. 对于InnoDB,SDI记录需要一个索引页,默认为16KB。However, SDI data is compressed to reduce the storage footprint.但是,SDI数据被压缩以减少存储占用空间。

For partitioned InnoDB tables comprised of multiple tablespaces, SDI data is stored in the tablespace file of the first partition.对于由多个表空间组成的分区InnoDB表,SDI数据存储在第一个分区的表空间文件中。

The MySQL server uses an internal API that is accessed during DDL operations to create and maintain SDI records.MySQL服务器使用在DDL操作期间访问的内部API来创建和维护SDI记录。

The IMPORT TABLE statement imports MyISAM tables based on information contained in .sdi files. IMPORT TABLE语句根据.sdi文件中包含的信息导入MyISAM表。For more information, see Section 13.2.5, “IMPORT TABLE Statement”.有关更多信息,请参阅第13.2.5节,“IMPORT TABLE语句”