数据库中的表信息
The TABLES table provides information about tables in databases.
INFORMATION_SCHEMA Name | SHOW Name | Remarks |
|---|---|---|
TABLE_CATALOG | def | |
TABLE_SCHEMA | Table_... | |
TABLE_NAME | Table_... | |
TABLE_TYPE | ||
ENGINE | Engine | MySQL extension |
VERSION | Version | The version number of the table's .frm file, MySQL extension |
ROW_FORMAT | Row_format | MySQL extension |
TABLE_ROWS | Rows | MySQL extension |
AVG_ROW_LENGTH | Avg_row_length | MySQL extension |
DATA_LENGTH | Data_length | MySQL extension |
MAX_DATA_LENGTH | Max_data_length | MySQL extension |
INDEX_LENGTH | Index_length | MySQL extension |
DATA_FREE | Data_free | MySQL extension |
AUTO_INCREMENT | Auto_increment | MySQL extension |
CREATE_TIME | Create_time | MySQL extension |
UPDATE_TIME | Update_time | MySQL extension |
CHECK_TIME | Check_time | MySQL extension |
TABLE_COLLATION | Collation | MySQL extension |
CHECKSUM | Checksum | MySQL extension |
CREATE_OPTIONS | Create_options | MySQL extension |
TABLE_COMMENT | Comment | MySQL extension |
Notes:
-
Refer to
SHOW TABLE STATUSfor field descriptions. -
TABLE_SCHEMAandTABLE_NAMEare a single field in aSHOWdisplay, for exampleTable_in_db1. -
TABLE_TYPEshould beBASE TABLEorVIEW. TheTABLEStable does not listTEMPORARYtables. -
For partitioned tables, the
ENGINEcolumn shows the name of the storage engine used by all partitions. (Previously, this column showedPARTITIONfor such tables.) -
The
TABLE_ROWScolumn isNULLif the table is in theINFORMATION_SCHEMAdatabase.For
InnoDBtables, the row count is only a rough estimate used in SQL optimization. (This is also true if theInnoDBtable is partitioned.) -
The
DATA_FREEcolumn shows the free space in bytes forInnoDBtables. -
UPDATE_TIMEdisplays a timestamp value for the lastUPDATE,INSERT, orDELETEperformed onInnoDBtables that are not partitioned. For MVCC, the timestamp value reflects theCOMMITtime, which is considered the last update time. Timestamps are not persisted when the server is restarted or when the table is evicted from theInnoDBdata dictionary cache.The
UPDATE_TIMEcolumn also shows this information for partitionedInnoDBtables. -
For partitioned
InnoDBtables, theCHECK_TIMEcolumn is alwaysNULL. -
We have nothing for the table's default character set.
TABLE_COLLATIONis close, because collation names begin with a character set name. -
The
CREATE_OPTIONScolumn showspartitionedif the table is partitioned.
The following statements are equivalent:
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'db_name'
[AND table_name LIKE 'wild']
SHOW TABLES
FROM db_name
[LIKE 'wild']
本文介绍了数据库中表的各项信息,包括表目录、模式、名称、类型等,并详细解释了每个字段的含义及其在MySQL中的扩展应用。
1894

被折叠的 条评论
为什么被折叠?



