首页 > 数据库技术 > 详细

010.mysql-mysql查询表注释、字段、备注

时间:2020-09-09 20:42:19      阅读:82      评论:0      收藏:0      [点我收藏+]

查询字段注释

 

 

表大小

第二种:查询所有数据的大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),MB) as data from information_schema.TABLES
第三种:查看指定数据库的大小,比如说:数据库apoyl
select concat(round(sum(DATA_LENGTH/1024/1024),2),MB) as data from information_schema.TABLES where table_schema=apoyl;
第四种:查看指定数据库的表的大小,比如说:数据库apoyl 中apoyl_test表
select concat(round(sum(DATA_LENGTH/1024/1024),2),MB) as data from information_schema.TABLES where table_schema=apoyl and table_name=apoyl_test;

 

 

表容量

库的每个scheme
select
table_schema as 数据库,
sum(table_rows) as 记录数,
sum(truncate(data_length/1024/1024, 2)) as 数据容量(MB),
sum(truncate(index_length/1024/1024, 2)) as 索引容量(MB)
from information_schema.tables
group by table_schema
order by sum(data_length) desc, sum(index_length) desc


库的所有
select 
 sum(记录数)
,sum(`数据容量(MB)`)
,sum(`索引容量(MB)`)
from 
(

select
table_schema as 数据库,
sum(table_rows) as 记录数,
sum(truncate(data_length/1024/1024, 2)) as 数据容量(MB),
sum(truncate(index_length/1024/1024, 2)) as 索引容量(MB)
from information_schema.tables
group by table_schema
order by sum(data_length) desc, sum(index_length) desc

)b;

 

010.mysql-mysql查询表注释、字段、备注

原文:https://www.cnblogs.com/star521/p/13640831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!