Note
This view is available starting with V1.4.
Purpose
The information_schema.TABLES view displays information about tables.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | The table catalog. |
| TABLE_SCHEMA | varchar(64) | NO | The database name. |
| TABLE_NAME | varchar(64) | NO | The table name. |
| TABLE_TYPE | varchar(64) | NO | The table type. |
| ENGINE | varchar(64) | NO | The storage engine type. |
| VERSION | bigint(0) unsigned | NO | The version. |
| ROW_FORMAT | varchar(10) | NO | The row format. |
| TABLE_ROWS | bigint(21) unsigned | NO | The number of rows in the table. |
| AVG_ROW_LENGTH | bigint(21) unsigned | NO | The average row length. |
| DATA_LENGTH | bigint(21) unsigned | NO | The data length, which is the storage space occupied by the table, calculated in macroblock size. Unit: Byte. |
| MAX_DATA_LENGTH | bigint(0) unsigned | NO | The maximum data length. |
| INDEX_LENGTH | bigint(0) unsigned | NO | The index length, which is the storage space occupied by non-primary key indexes, calculated in macroblock size. Unit: Byte.
NoteThis column is no longer displayed as |
| DATA_FREE | bigint(0) unsigned | NO | The size of the remaining space. |
| 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 check time of the table. |
| TABLE_COLLATION | varchar(32) | NO | The collation of the table. |
| CHECKSUM | bigint(0) unsigned | NO | The checksum. |
| CREATE_OPTIONS | varchar(255) | NO | The create options. |
| TABLE_COMMENT | text | NO | The comment of the table. |
Sample query
Query the information about tables in the oceanbase database.
obclient [oceanbase]> SELECT * FROM information_schema.tables limit 1\G
The query result is as follows:
```shell
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: mysql
TABLE_NAME: help_topic
TABLE_TYPE: SYSTEM 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: 2024-07-23 15:19:56
UPDATE_TIME: 2024-07-23 15:19:56
CHECK_TIME: NULL
TABLE_COLLATION: utf8mb4_general_ci
CHECKSUM: NULL
CREATE_OPTIONS: NULL
TABLE_COMMENT:
References
For more information about tables, see View a table.