【转】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_ ...
随机推荐
- linux shell 脚本攻略学习5---find命令详解
1.find命令详解 语法: find base_path#base_path可以是任何位置,find会从该位置向下找 实例: amosli@amosli-pc:~$ find /home/amosl ...
- iOS 10 的一个重要更新-新的通知推送 API
iOS 10 最重要的变化可能就是通知 API 的重构了.本文用一个简单闹钟的例子介绍了 User Notification 的 API 变化和新功能. 简介 很久以前,开发者就可以在 iOS 里预约 ...
- hashCode和identityHashCode底层是怎么生成的
前言:在工作中使用==埋下的坑这篇博文的最后,我想到了两个问题,其中一个是——为什么 int int1=99;int int2=99;int1和int2的identityHashCode是 ...
- svn搭建本地服务端
使用VisualSVN Server来完成,下载地址:https://www.visualsvn.com/server/download/ 我安装的版本是3.3.1,安装的时候选择了标准版本,另外一个 ...
- C/C++/动态链接库DLL中函数的调用约定与名称修饰
参见:http://blog.twofei.com/cc/impl/calling-convension.html 调用约定(Calling Convention)是指在程序设计语言中为了实现函数调用 ...
- ERROR: No query specified
mysql中执行show命令的时候,提示以下信息: mysql> show variables like 'datadir'\G; *************************** 1. ...
- 启用跨源请求 (CORS)
https://docs.microsoft.com/zh-cn/aspnet/core/security/cors
- 转 Java笔记:Java内存模型
Java笔记:Java内存模型 2014.04.09 | Comments 1. 基本概念 <深入理解Java内存模型>详细讲解了java的内存模型,这里对其中的一些基本概念做个简单的笔记 ...
- jmeter 正则获取参数集合和ForEach控制器结合使用
怎么把第一个请求获取的返回的多个id,在第二个请求中逐个以单个id作为请求参数来请求? 为了解决这个问题,模拟下该场景 1.请求www.163.com 主页,获取响应中的所有数字,这个获取的数字集合暂 ...
- shell 计算时间差
#!/bin/bash #date_5='awk 'BEGIN{print strftime("%H:%M",(systime()-300))}'' #ps -ef | grep ...