SHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of information about each non-TEMPORARYtable. You can also get this list using the mysqlshow --status db_name command. The LIKE clause, if present, indicates which table names to match. The WHERE clause can be given to select rows using more general conditions, as discussed in Section 21.31, “Extensions to SHOW Statements”.

This statement also displays information about views.

SHOW TABLE STATUS output has the following columns:

  • Name

    The name of the table.

  • Engine

    The storage engine for the table. See Chapter 15, Alternative Storage Engines.

  • Version

    The version number of the table's .frm file.

  • Row_format

    The row-storage format (FixedDynamicCompressedRedundantCompact). For MyISAM tables, (Dynamiccorresponds to what myisamchk -dvv reports as Packed. The format of InnoDB tables is reported as Redundantor Compact. For the Barracuda file format of the InnoDB Plugin, the format may be Compressed or Dynamic.

  • Rows

    The number of rows. Some storage engines, such as MyISAM, store the exact count. For other storage engines, such as InnoDB, this value is an approximation, and may vary from the actual value by as much as 40 to 50%. In such cases, use SELECT COUNT(*) to obtain an accurate count.

    The Rows value is NULL for tables in the INFORMATION_SCHEMA database.

  • Avg_row_length

    The average row length.

  • Data_length

    The length of the data file.

  • Max_data_length

    The maximum length of the data file. This is the total number of bytes of data that can be stored in the table, given the data pointer size used.

  • Index_length

    The length of the index file.

  • Data_free

    The number of allocated but unused bytes.

    This information is also shown for InnoDB tables (previously, it was in the Comment value). InnoDB tables report the free space of the tablespace to which the table belongs. For a table located in the shared tablespace, this is the free space of the shared tablespace. If you are using multiple tablespaces and the table has its own tablespace, the free space is for only that table. Free space means the number of completely free 1MB extents minus a safety margin. Even if free space displays as 0, it may be possible to insert rows as long as new extents need not be allocated.

    For partitioned tables, this value is only an estimate and may not be absolutely correct. A more accurate method of obtaining this information in such cases is to query the INFORMATION_SCHEMA.PARTITIONS table, as shown in this example:

    SELECT    SUM(DATA_FREE)
    FROM INFORMATION_SCHEMA.PARTITIONS
    WHERE TABLE_SCHEMA = 'mydb'
    AND TABLE_NAME = 'mytable';

    For more information, see Section 21.12, “The INFORMATION_SCHEMA PARTITIONS Table”.

  • Auto_increment

    The next AUTO_INCREMENT value.

  • Create_time

    When the table was created.

  • Update_time

    When the data file was last updated. For some storage engines, this value is NULL. For example, InnoDB stores multiple tables in its system tablespace and the data file timestamp does not apply. Even with file-per-table mode with each InnoDB table in a separate .ibd file, change buffering can delay the write to the data file, so the file modification time is different from the time of the last insert, update, or delete. For MyISAM, the data file timestamp is used; however, on Windows the timestamp is not updated by updates so the value is inaccurate.

  • Check_time

    When the table was last checked. Not all storage engines update this time, in which case the value is always NULL.

  • Collation

    The table's character set and collation.

  • Checksum

    The live checksum value (if any).

  • Create_options

    Extra options used with CREATE TABLE. The original options supplied when CREATE TABLE is called are retained and the options reported here may differ from the active table settings and options.

  • Comment

    The comment used when creating the table (or information as to why MySQL could not access the table information).

For MEMORY tables, the Data_lengthMax_data_length, and Index_length values approximate the actual amount of allocated memory. The allocation algorithm reserves memory in large amounts to reduce the number of allocation operations.

For NDBCLUSTER tables, the output of this statement shows appropriate values for the Avg_row_length andData_length columns, with the exception that BLOB columns are not taken into account

For views, all the fields displayed by SHOW TABLE STATUS are NULL except that Name indicates the view name andComment says view.

show table status的更多相关文章

  1. mysqldump: Couldn't execute 'show table status '解决方法

    执行:[root@host2 lamp]# mysqldump -F -R -E --master-data=2   -p -A --single-transaction 在控制台端出现 mysqld ...

  2. mysql学习之-show table status(获取表的信息)参数说明

    --获取表的信息mysql> show table status like 'columns_priv'\G;*************************** 1. row ******* ...

  3. A better SHOW TABLE STATUS

    From command line we have the entire MySQL server on hands (if we have privileges too of course) but ...

  4. mysql命令学习笔记(1):show table status like 'user';显示表的相关信息

    show table status like 'user';显示表的相关信息 +------------+--------+---------+------------+------+-------- ...

  5. mysql中使用show table status 查看表信息

    本文导读:在使用mysql数据库时,经常需要对mysql进行维护,查询每个库.每个表的具体使用情况,Mysql数据库可以通过执行SHOW TABLE STATUS命令来获取每个数据表的信息. 一.使用 ...

  6. mysql中使用show table status 查看表信息

    学习标签: mysql 本文导读:在使用mysql数据库时,经常需要对mysql进行维护,查询每个库.每个表的具体使用情况,Mysql数据库可以通过执行SHOW TABLE STATUS命令来获取每个 ...

  7. mysql table status

    SHOW TABLE STATUS 能获得表的信息 可以SHOW TABLE STATUS where name='表名'

  8. mysql中 show table status 获取表信息

    用法 mysql>show table status; mysql>show table status like 'esf_seller_history'\G; mysql>show ...

  9. MySQL通过SHOW TABLE STATUS查看库中所有表的具体信息

    有时候我们想看下指定库下所有表的使用情况,比如,查询表的Table大小,什么时候创建的,数据最近被更新的时间(即最近一笔insert/update/delete的时间).这些信息对我们进行库表维护很有 ...

随机推荐

  1. (转)JS浮动窗口(随浏览器滚动而滚动)

    原文:http://hi.baidu.com/aiyayaztt/item/4201c55a6b729dced2e10c79 JS浮动窗口(随浏览器滚动而滚动) 往往用于一些联系方式,互动平台模块,随 ...

  2. hdu 2096

    PS:做不出前面几道题...很不爽..扒拉了几下找了简单题来做.... #include "stdio.h" int cal(int a); int main(){ int a,b ...

  3. openstack 本地化

    研究了一下 openstack中的本地化:主要使用gettext模块: 其中本地化包括对一般字符串的本地化和log的本地化:   (1) _localedir = os.environ.get('es ...

  4. 【转】Web应用的组件化开发(二)

    原文转自:http://blog.jobbole.com/56170/ 管控平台 在上一篇中我们提到了组件化的大致思路,这一篇主要讲述在这么做之后,我们需要哪些外围手段去管控整个开发过程.从各种角度看 ...

  5. 快速实现Magento多语言的设置和产品数据的多语言方法

    MagenTo默认支持多语言网店,不过要使用多语言功能,需要进行一些设置. 一.后台多语言支持(中文化) Magento登录后台时默认的是显示的是英文界面,在页面左下角选择语言为中文就会跳转为中文界面 ...

  6. 联合与枚举 、 高级指针 、 C语言标准库(一)

    1 输入一个整数,求春夏秋冬 1.1 问题 在实际应用中,有的变量只有几种可能取值.如人的性别只有两种可能取值,星期只有七种可能取值.在 C 语言中对这样取值比较特殊的变量可以定义为枚举类型.所谓枚举 ...

  7. cmake在实际复杂项目中的使用

    在实际复杂的项目之中,会有很多的源文件,以及对于库的依赖,如果直接使用makefile会比较的繁琐,而且makefile的推导规则也非常多,对多目录的支持也比较复杂. 最近看了一下cmake,发现配置 ...

  8. DNS劫持和DNS污染解决办法

    编号:1013时间:2016年5月26日09:35:27功能:DNS劫持和DNS污染解决办法URL : http://www.itechzero.com/dns-hijacking-dns-pollu ...

  9. bold, big, blink

  10. VMDK镜像迁移到KVM(二)

    KVM has the ability to use VMware's .vmdk disk files directly, as long as the disk is wholly contain ...