INNODB_TABLES 表提供有关 InnoDB 表的元数据。The INNODB_TABLES table provides
metadata about InnoDB tables.
有关相关的使用信息和示例,请参见 第 17.15.3 节,“InnoDB INFORMATION_SCHEMA 模式对象表”。For related usage information and examples, see Section 17.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
INNODB_TABLES 表具有以下列:The INNODB_TABLES table has these
columns:
TABLE_IDInnoDB表的标识符。该值在实例中的所有数据库中都是唯一的。An identifier for theInnoDBtable. This value is unique across all databases in the instance.NAMENAME表的名称,如果适用,前面加上模式(数据库)名称(例如
test/t1)。数据库和用户表的名称保持原定义的大小写,可能会受到lower_case_table_names设置的影响。The name of the table, preceded by the schema (database) name where appropriate (for example,test/t1). Names of databases and user tables are in the same case as they were originally defined, possibly influenced by thelower_case_table_namessetting.FLAG一个数字值,表示有关表格式和存储特性的位级信息。A numeric value that represents bit-level information about table format and storage characteristics.
N_COLS表中的列数。报告的数量包括由
InnoDB创建的三列隐藏列(DB_ROW_ID、DB_TRX_ID和DB_ROLL_PTR)。报告的数量还包括如果存在的 虚拟生成列。The number of columns in the table. The number reported includes three hidden columns that are created byInnoDB(DB_ROW_ID,DB_TRX_ID, andDB_ROLL_PTR). The number reported also includes virtual generated columns, if present.SPACEAn identifier for the tablespace where the table resides. 0 means the
InnoDBsystem tablespace. Any other number represents either a 表空间中的表那样释放回操作系统。 tablespace or a general tablespace. This identifier stays the same after aTRUNCATE TABLEstatement. For file-per-table tablespaces, this identifier is unique for tables across all databases in the instance.An identifier for the tablespace where the table resides. 0 means theInnoDBsystem tablespace. Any other number represents either a file-per-table tablespace or a general tablespace. This identifier stays the same after aTRUNCATE TABLEstatement. For file-per-table tablespaces, this identifier is unique for tables across all databases in the instance.ROW_FORMATROW_FORMAT表的行格式(
Compact、Redundant、Dynamic或Compressed)。The table's row format (Compact,Redundant,Dynamic, orCompressed).ZIP_PAGE_SIZE压缩页面大小。仅适用于行格式为
Compressed的表。The zip page size. Applies only to tables with a row format ofCompressed.SPACE_TYPE表所属的表空间类型。可能的值包括用于系统表空间的
System,用于通用表空间的General,以及用于每表文件表空间的Single。使用CREATE TABLE或ALTER TABLETABLESPACE=innodb_system分配到系统表空间的表,其SPACE_TYPE为General。更多信息,请参见CREATE TABLESPACE。The type of tablespace to which the table belongs. Possible values includeSystemfor the system tablespace,Generalfor general tablespaces, andSinglefor file-per-table tablespaces. Tables assigned to the system tablespace usingCREATE TABLEorALTER TABLETABLESPACE=innodb_systemhave aSPACE_TYPEofGeneral. For more information, seeCREATE TABLESPACE.INSTANT_COLS在使用
ALTER TABLE ... ADD COLUMN并指定ALGORITHM=INSTANT添加第一个即时列之前存在的列数。此列不再使用。The number of columns that existed before the first instant column was added usingALTER TABLE ... ADD COLUMNwithALGORITHM=INSTANT. This column is no longer used.TOTAL_ROW_VERSIONS表的行版本数量。初始值为 0。通过添加或删除列的
ALTER TABLE ... ALGORITHM=INSTANT操作,该值会增加。当由于表重建ALTER TABLE或OPTIMIZE TABLE操作而重建具有即时添加或删除列的表时,该值会重置为 0。有关详细信息,请参见 列操作。The number of row versions for the table. The initial value is 0. The value is incremented byALTER TABLE ... ALGORITHM=INSTANToperations that add or remove columns. When a table with instantly added or dropped columns is rebuilt due to a table-rebuildingALTER TABLEorOPTIMIZE TABLEoperation, the value is reset to 0. For more information, see Column Operations.最大
TOTAL_ROW_VERSIONS值为 64。从 MySQL 9.1.0 开始,此最大值从 64 更改为 255。The maximumTOTAL_ROW_VERSIONSvalue is 64. This maximum value changes from 64 to 255 as of MySQL 9.1.0.
示例Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE TABLE_ID = 214\G
*************************** 1. row ***************************
TABLE_ID: 1064
NAME: test/t1
FLAG: 33
N_COLS: 6
SPACE: 3
ROW_FORMAT: Dynamic
ZIP_PAGE_SIZE: 0
SPACE_TYPE: Single
INSTANT_COLS: 0
TOTAL_ROW_VERSIONS: 3
注释Notes
你必须拥有
PROCESS权限才能查询此表。You must have thePROCESSprivilege to query this table.使用
INFORMATION_SCHEMACOLUMNS表或SHOW COLUMNS语句查看关于此表列的更多信息,包括数据类型和默认值。Use theINFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.