SHOW TABLE STATUS
Syntax
SHOW TABLE STATUS [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]
Contents
Description
SHOW TABLE STATUS
works like SHOW TABLES, but provides more extensive information about each table (until MariaDB 11.2.0, only non-TEMPORARY tables are shown).
The LIKE
clause, if present on its own, indicates which table names to
match. The WHERE
and LIKE
clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.
The following information is returned:
Column | Description |
---|---|
Name | Table name. |
Engine | Table storage engine. |
Version | Version number from the table's .frm file. |
Row_format | Row format (see InnoDB, Aria and MyISAM row formats). |
Rows | Number of rows in the table. Some engines, such as InnoDB may store an estimate. |
Avg_row_length | Average row length in the table. |
Data_length | For InnoDB, the index size, in pages, multiplied by the page size. For Aria and MyISAM, length of the data file, in bytes. For MEMORY, the approximate allocated memory. |
Max_data_length | Maximum length of the data file, ie the total number of bytes that could be stored in the table. Not used in InnoDB. |
Index_length | Length of the index file. |
Data_free | Bytes allocated but unused. For InnoDB tables in a shared tablespace, the free space of the shared tablespace with small safety margin. An estimate in the case of partitioned tables - see the PARTITIONS table. |
Auto_increment | Next AUTO_INCREMENT value. |
Create_time | Time the table was created. Some engines just return the ctime information from the file system layer here, in that case the value is not necessarily the table creation time but rather the time the file system metadata for it had last changed. |
Update_time | Time the table was last updated. On Windows, the timestamp is not updated on update, so MyISAM values will be inaccurate. In InnoDB, if shared tablespaces are used, will be NULL , while buffering can also delay the update, so the value will differ from the actual time of the last UPDATE , INSERT or DELETE . |
Check_time | Time the table was last checked. Not kept by all storage engines, in which case will be NULL . |
Collation | Character set and collation. |
Checksum | Live checksum value, if any. |
Create_options | Extra CREATE TABLE options. |
Comment | Table comment provided when MariaDB created the table. |
Max_index_length | Maximum index length (supported by MyISAM and Aria tables). |
Temporary | Until MariaDB 11.2.0, placeholder to signal that a table is a temporary table and always "N", except "Y" for generated information_schema tables and NULL for views. From MariaDB 11.2.0, will also be set to "Y" for local temporary tables. |
Similar information can be found in the information_schema.TABLES table as well as by using mariadb-show:
mariadb-show --status db_name
Views
For views, all columns in SHOW TABLE STATUS
are NULL
except 'Name' and 'Comment'
Example
show table status\G *************************** 1. row *************************** Name: bus_routes Engine: InnoDB Version: 10 Row_format: Dynamic Rows: 5 Avg_row_length: 3276 Data_length: 16384 Max_data_length: 0 Index_length: 0 Data_free: 0 Auto_increment: NULL Create_time: 2017-05-24 11:17:46 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment:
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.