information_schema.tables字段說明
|
字段
|
含義
|
|
Table_catalog
|
數據表登記目錄
|
|
Table_schema
|
數據表所屬的數據庫名
|
|
Table_name
|
表名稱
|
|
Table_type
|
表類型[system view|base table]
|
|
Engine
|
使用的數據庫引擎[MyISAM|CSV|InnoDB]
|
|
Version
|
版本,默認值10
|
|
Row_format
|
行格式[Compact|Dynamic|Fixed]
|
|
Table_rows
|
表里所存多少行數據
|
|
Avg_row_length
|
平均行長度
|
|
Data_length
|
數據長度
|
|
Max_data_length
|
最大數據長度
|
|
Index_length
|
索引長度
|
|
Data_free
|
空間碎片
|
|
Auto_increment
|
做自增主鍵的自動增量當前值
|
|
Create_time
|
表的創建時間
|
|
Update_time
|
表的更新時間
|
|
Check_time
|
表的檢查時間
|
|
Table_collation
|
表的字符校驗編碼集
|
|
Checksum
|
校驗和
|
|
Create_options
|
創建選項
|
|
Table_comment
|
表的注釋、備注
|
1、use information_schema;
2、select table_name,table_rows,ENGINE,table_type,Avg_row_length,Data_length,Max_data_length,Index_length,Data_free from tables where TABLE_SCHEMA = 'databasename' order by table_rows desc;
//碎片整理
OPTIMIZE TABLE tablename
