【转】MySQL查看表占用空间大小(转)
//先进去MySQL自带管理库:information_schema
//自己的数据库:rokid_cas_music_test
//自己的表:data_song_thirdparty mysql> use information_schema;
Database changed
mysql> select data_length,index_length
from information_schema.tables where table_schema='rokid_cas_music_test' and table_name = 'data_song_thirdparty';
+-------------+--------------+
| data_length | index_length |
+-------------+--------------+
| 15993798656 | 8825700352 |
+-------------+--------------+
1 row in set (0.00 sec)
row in set (0.02 sec) mysql> select concat(round(sum(data_length//),),'MB') as data_length_MB,
concat(round(sum(index_length//),),'MB') as index_length_MB
from information_schema.tables where
table_schema='rokid_cas_music_test'
and table_name = 'data_song_thirdparty';
+----------------+-----------------+
| data_length_MB | index_length_MB |
+----------------+-----------------+
| 15252.88MB | 8416.84MB |
+----------------+-----------------+
1 row in set (0.01 sec)
row in set (0.03 sec)
查询MySQL数据库中每个数据库数据和索引所占的数据大小,单位G,保留两位小数
select table_schema,round(sum(data_length)/1024/1024/1024,3) as datasize, round(sum(index_length)/1024/1024/1024,3) as indexsize
from information_schema.tables
where table_schema != 'information_schema' and table_schema != 'mysql' and table_schema != 'performance_schema'
group by table_schema
order by datasize desc;
查询MySQL数据库中每个表的数据和索引所占的数据大小,单位G,保留两位小数
select table_schema,table_name,round(sum(data_length)/1024/1024/1024,3) as datasize, round(sum(index_length)/1024/1024/1024,3) as indexsize
from information_schema.tables
where table_schema != 'information_schema' and table_schema != 'mysql' and table_schema != 'performance_schema'
group by table_schema,table_name
order by datasize desc;
【转自】:http://www.cnblogs.com/qq78292959/archive/2012/12/26/2833698.html
【转】MySQL查看表占用空间大小(转)的更多相关文章
- MySQL查看表占用空间大小(转)
MySQL查看表占用空间大小(转) //先进去MySQL自带管理库:information_schema //自己的数据库:dbwww58com_kuchecarlib //自己的表:t_carmod ...
- MySQL查看表占用空间大小
需求:我们在选购服务器硬盘时,通常需要先估算一下数据量.比如我们现在做的项目,百万级用户,然后在现有的数据结构中插入一万条数据,然后根据相应的需求去计算出实际生产中的数据量. 前言:在mysql中有一 ...
- mysql查看表大小
mysql查看表大小 一:命令 show table status like 'table_name'\G; mysql> show table status like 'x'\G; . row ...
- SQL2000查看表的大小
SQL2000查看表的大小 标签: sqlsql server数据库报表tableinsert 2011-06-08 11:47 4013人阅读 评论(0) 收藏 举报 SQL2000查看表的大小 本 ...
- MySQL 查看表结构
mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; use information_s ...
- mysql查看表结构命令
mysql查看表结构命令 mysql查看表结构命令,如下: desc 表名;show columns from 表名;describe 表名;show create table 表名; use inf ...
- mysql查看表结构,字段等命令
mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名;
- 检测SQL Server表占用空间大小SQL
检测SQL Server表占用空间大小SQL,要先选择需要查询的数据库,然后点击执行下面脚本. ),ROWS ),reserved ) ,Data ) ,index_size ) ,Unused ) ...
- Oracle 表的行数、表占用空间大小,列的非空行数、列占用空间大小 查询
--表名,表占用空间大小(MB),行数select table_name, round(num_rows * avg_row_len /1024/1024, 8) as total_len, num_ ...
随机推荐
- NSNotificationCenter实现原理
# 前言 Cocoa中使用NSNotification.NSNotificationCenter和KVO来实现观察者模式,实现对象间一对多的依赖关系. 本篇文章主要来讨论NSNotification和 ...
- http状态--status[查询的资料备注]
HTTP 状态消息 当浏览器从 web 服务器请求服务时,可能会发生错误. 从而有可能会返回下面的一系列状态消息: 1xx: 信息 消息: 描述: 100 Continue 服务器仅接收到部分请求,但 ...
- IOC 之深入理解 Spring IoC
在一开始学习 Spring 的时候,我们就接触 IoC 了,作为 Spring 第一个最核心的概念,我们在解读它源码之前一定需要对其有深入的认识,本篇为[死磕 Spring]系列博客的第一篇博文,主要 ...
- webpack window 添加ES6支出
著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:张轩链接:http://zhuanlan.zhihu.com/p/20367175来源:知乎 如果现在你的项目还没有对ES6的 ...
- 【colaboratory】ModuleNotFoundError: No module named 'forward'
在colaboratory中,import 自己写的 py 文件往往会爆出 ModuleNotFoundError: No module named ‘forward' 的错误. 就其原因,是由于 D ...
- php性能优化(一)压力測试工具篇
ab使用 Apache附带的压力測试工具ab,很easy使用,而且全然能够摸你各种条件对Webserver发起測试请求.ab能够直接在Webserver本地发起測试请求.这对于须要了解server的处 ...
- SharePoint 2013 安装 Service Pack 1
Problem 当迁移SharePoint 的时候,执行Move-SPSite 命令,将指定的Site Collection移动到目标内容数据库中时,提示以下错误:Cannot complete th ...
- SharePoint 2013混合模式登陆中 使用 自定义登陆页
接前一篇博客<SharePoint 2013自定义Providers在基于表单的身份验证(Forms-Based-Authentication)中的应用>,当实现混合模式登陆后,接着我们就 ...
- python groupby 函数 as_index
在官方网站中对as_index有以下介绍: as_index : boolean, default True For aggregated output, return object with gro ...
- Java – Generate random integers in a rangejava获取某个范围内的一个随机数
In this article, we will show you three ways to generate random integers in a range. java.util.Rando ...