Overview
The information_schema.TABLES view displays table information.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | Table directory. |
| TABLE_SCHEMA | varchar(64) | NO | The name of the database. |
| TABLE_NAME | varchar(64) | NO | Table name. |
| TABLE_TYPE | varchar(64) | NO | Table type. |
| ENGINE | varchar(64) | NO | The type of storage engine used. |
| VERSION | bigint(0) unsigned | NO | Version. |
| ROW_FORMAT | varchar(10) | NO | Row format. |
| TABLE_ROWS | bigint(21) unsigned | NO | The number of rows in the table. |
| AVG_ROW_LENGTH | bigint(21) unsigned | NO | Average row length. |
| DATA_LENGTH | bigint(21) unsigned | NO | Data length, which is the storage space occupied by a table. It is calculated in macroblocks and is measured in bytes. |
| MAX_DATA_LENGTH | bigint(0) unsigned | NO | Maximum data length. |
| INDEX_LENGTH | bigint(0) unsigned | NO | Index length, which is the storage space occupied by non-primary key indexes. It is calculated in macroblocks and is in bytes. |
| DATA_FREE | bigint(0) unsigned | NO | The remaining space size. |
| AUTO_INCREMENT | bigint(0) unsigned | NO | The current auto-increment value. |
| CREATE_TIME | datetime | NO | The creation time of the table. |
| UPDATE_TIME | datetime | NO | The last update time of the table. |
| CHECK_TIME | datetime | NO | The last time the table was checked. |
| TABLE_COLLATION | varchar(32) | NO | The method for comparing character sets of tables. |
| CHECKSUM | bigint(0) unsigned | NO | Checksum. |
| CREATE_OPTIONS | varchar(255) | NO | Creation options. |
| TABLE_COMMENT | text | NO | The remarks of the table. |
| AUTO_SPLIT | varchar(16) | NO | Indicates whether automatic partitioning is enabled for the table. Valid values:
|
| AUTO_SPLIT_TABLET_SIZE | bigint(20) unsigned | NO | Represents the threshold for automatic partition splitting. When the field AUTO_SPLIT The value is FALSE When, AUTO_SPLIT_TABLET_SIZE The value is 0. |
| ORGANIZATION | varchar(12) | NO | Indicates the table organization mode. Valid values:
|
| ROW_SECURITY | char(3) | NO | Indicates whether row-level security (RLS) is enabled for the table. Corresponding execution ALTER TABLE ... ENABLE ROW LEVEL SECURITY. Valid values:
ENABLE, still at NO. |
| ROW_SECURITY_FORCED | char(3) | NO | Indicates whether row-level privileges are enforced for all users (including the table owner). The corresponding execution statement is ALTER TABLE ... FORCE ROW LEVEL SECURITY. Valid values:
|
Sample query
Query the details of table t1.
SELECT * FROM information_schema.tables WHERE table_name = 't1'\G
The query result is as follows:
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: t1
TABLE_TYPE: BASE TABLE
ENGINE: InnoDB
VERSION: NULL
ROW_FORMAT: DYNAMIC
TABLE_ROWS: 0
AVG_ROW_LENGTH: 0
DATA_LENGTH: 0
MAX_DATA_LENGTH: NULL
INDEX_LENGTH: 0
DATA_FREE: NULL
AUTO_INCREMENT: NULL
CREATE_TIME: 2025-02-21 13:59:36
UPDATE_TIME: 2025-02-21 13:59:46
CHECK_TIME: NULL
TABLE_COLLATION: utf8mb4_general_ci
CHECKSUM: NULL
CREATE_OPTIONS: NULL
TABLE_COMMENT:
AUTO_SPLIT: FALSE
AUTO_SPLIT_TABLET_SIZE: 0
ORGANIZATION: INDEX
ROW_SECURITY: NO
ROW_SECURITY_FORCED: NO
1 row in set