INNODB_FIELDS 表提供有关 InnoDB 索引的关键列(字段)的元数据。The INNODB_FIELDS table provides
metadata about the key columns (fields) of
InnoDB indexes.
有关相关的使用信息和示例,请参见 第 17.15.3 节,“InnoDB INFORMATION_SCHEMA 模式对象表”。For related usage information and examples, see Section 17.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
INNODB_FIELDS 表有以下列:The INNODB_FIELDS table has these
columns:
INDEX_ID与该键字段相关联的索引标识符;值与
INNODB_INDEXES.INDEX_ID相同。An identifier for the index associated with this key field; the same value asINNODB_INDEXES.INDEX_ID.NAMENAME表中原始列的名称;值与
INNODB_COLUMNS.NAME相同。The name of the original column from the table; the same value asINNODB_COLUMNS.NAME.POS键字段在索引中的序号位置,从 0 开始并按顺序递增。当列被删除时,剩余列将重新排序,以确保序列没有空缺。The ordinal position of the key field within the index, starting from 0 and incrementing sequentially. When a column is dropped, the remaining columns are reordered so that the sequence has no gaps.
示例Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FIELDS WHERE INDEX_ID = 117\G
*************************** 1. row ***************************
INDEX_ID: 117
NAME: col1
POS: 0
备注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.