美文网首页
MySQL 的 show table status

MySQL 的 show table status

作者: 后厂村村长 | 来源:发表于2021-09-13 16:40 被阅读0次

命令解析

show TABLE STATUS 该命令用于返回当前库中的所有表概览,通过添加pattern 可以显示指定表的概览; 譬如:show TABLE STATUS like 'mytable%' ;
返回信息格式如下:

show TABLE STATUS like 'my_item%'\G;
*************************** 1. row ***************************
           Name: my_item
         Engine: InnoDB
        Version: 10
     Row_format: Dynamic
           Rows: 43
 Avg_row_length: 381
    Data_length: 16384
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: 45
    Create_time: 2021-09-12 11:55:09
    Update_time: 2021-09-12 17:42:49
     Check_time: NULL
      Collation: utf8_general_ci
       Checksum: NULL
 Create_options:
        Comment:
1 row in set (0.00 sec)

其中需要注意的是 Row_format 这一列的值。
Row_format 的可能取值有:Fixed, Dynamic, Compressed, Redundant, Compact 等。
Dynamic,代表行格式为动态行,行长度可变,说明表中存在varchar或text或Blob类型字段。
fixed,代表固定行,是指行长度不变,说明表中都是int或har类型字段。执行效率高,不容易产生碎片。但char会导致占用固定长度的空间,长度不足时,会填补空格;

相关文章

网友评论

      本文标题:MySQL 的 show table status

      本文链接:https://www.haomeiwen.com/subject/ckjfgltx.html