文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 72%

28.4.23 INFORMATION_SCHEMA INNODB_TABLES 表28.4.23 The INFORMATION_SCHEMA INNODB_TABLES Table

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_ID

    InnoDB 表的标识符。该值在实例中的所有数据库中都是唯一的。An identifier for the InnoDB table. 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 the lower_case_table_names setting.

  • 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 by InnoDB (DB_ROW_ID, DB_TRX_ID, and DB_ROLL_PTR). The number reported also includes virtual generated columns, if present.

  • SPACE

    An identifier for the tablespace where the table resides. 0 means the InnoDB system tablespace. Any other number represents either a 表空间中的表那样释放回操作系统。 tablespace or a general tablespace. This identifier stays the same after a TRUNCATE TABLE statement. 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 the InnoDB system tablespace. Any other number represents either a file-per-table tablespace or a general tablespace. This identifier stays the same after a TRUNCATE TABLE statement. 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, or Compressed).

  • ZIP_PAGE_SIZE

    压缩页面大小。仅适用于行格式为Compressed的表。The zip page size. Applies only to tables with a row format of Compressed.

  • SPACE_TYPE

    表所属的表空间类型。可能的值包括用于系统表空间的System,用于通用表空间的General,以及用于每表文件表空间的Single。使用CREATE TABLE或ALTER TABLE TABLESPACE=innodb_system 分配到系统表空间的表,其SPACE_TYPE为General。更多信息,请参见CREATE TABLESPACE。The type of tablespace to which the table belongs. Possible values include System for the system tablespace, General for general tablespaces, and Single for file-per-table tablespaces. Tables assigned to the system tablespace using CREATE TABLE or ALTER TABLE TABLESPACE=innodb_system have a SPACE_TYPE of General. For more information, see CREATE TABLESPACE.

  • INSTANT_COLS

    在使用 ALTER TABLE ... ADD COLUMN 并指定 ALGORITHM=INSTANT 添加第一个即时列之前存在的列数。此列不再使用。The number of columns that existed before the first instant column was added using ALTER TABLE ... ADD COLUMN with ALGORITHM=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 by ALTER TABLE ... ALGORITHM=INSTANT operations that add or remove columns. When a table with instantly added or dropped columns is rebuilt due to a table-rebuilding ALTER TABLE or OPTIMIZE TABLE operation, the value is reset to 0. For more information, see Column Operations.

    最大 TOTAL_ROW_VERSIONS 值为 64。从 MySQL 9.1.0 开始,此最大值从 64 更改为 255。The maximum TOTAL_ROW_VERSIONS value 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 the PROCESS privilege to query this table.

  • 使用 INFORMATION_SCHEMA COLUMNS 表或 SHOW COLUMNS 语句查看关于此表列的更多信息,包括数据类型和默认值。Use the INFORMATION_SCHEMA COLUMNS table or the SHOW COLUMNS statement to view additional information about the columns of this table, including data types and default values.