mysql show table status 的替代方案:获得更多更具体的表信息
来源:互联网 发布:sqlserver日常维护 编辑:程序博客网 时间:2024/06/11 17:05
mysql提供的show table status like ‘%xxx’
可以方便的查看某些表的信息,但是使用这个语句没法对结果集进行排序,不如我想看数据库中那个表中的数据量最大就办不到了?
其实可以通过访问information_schema数据库获得show table status
的相关信息
比如:
SELECT * FROM information_schema.tables WHERE table_schema = DATABASE();
获得按数据量排序的信息:
SELECT table_name,ENGINE,VERSION,ROW_FORMAT,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 FROM information_schema.TABLESWHERE table_schema = DATABASE()ORDER BY table_rows DESC
也可以指定数据库:
SELECT table_name,Engine,Version,Row_format,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 FROM information_schema.tablesWHERE table_schema = 'yourdb';
还可以方便的查询到那些表的引擎不是InnoDB,如下sql语句:
SELECT table_name,Engine,Version,Row_format,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 FROM information_schema.tablesWHERE table_schema = 'yourdb' and Engine != 'InnoDB'
原文地址:http://outofmemory.cn/code-snippet/2411/mysql-show-table-status-tidai-scheme-get-gengduo-geng-juti-table-information
0 0
- mysql show table status 的替代方案:获得更多更具体的表信息
- mysql学习之-show table status(获取表的信息)参数说明
- 用好mysql的show table status
- 美化mysql SHOW TABLE STATUS的输出
- mysql中 show table status 获取表信息
- MySQL的SHOW STATUS
- MySQL - SHOW TABLE STATUS
- mysql 输出表的详细信息详解 show table status like '表名'
- mysql 输出表的详细信息 show table status like '表名'
- MySQL维护命令集锦--查看表的状态(show table status)
- [转]MySQL维护命令集锦--查看表的状态(show table status)
- mysql的 show status 和 show variables
- mysql的show status详解
- mysql的show status详解
- smartforms替代table的方案!
- MySQL SHOW TABLE STATUS 字段
- MySQL- SHOW TABLE STATUS命令
- MySQL- SHOW TABLE STATUS命令
- 欢迎使用CSDN-markdown编辑器
- IOS5 ARC unsafe_unretained等说明
- JS/jQuery常用代码片段
- 详解Java GC的工作原理+Minor GC、FullGC
- Storm在推荐系统中的应用
- mysql show table status 的替代方案:获得更多更具体的表信息
- android 设置手机状态栏的背景颜色
- 常用MySQL操作
- forward 和redirect的区别
- Cursor工具类,用于支持根据列名取得对应的值
- Android Binder机制(超级详尽)
- zoj 3911 Prime Query (ZOJ Monthly, October 2015 - I)
- Java 的序列化 (Serialization) 教程
- 得到当前日期是星期几