【转】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_ ...
随机推荐
- 【LeetCode】201. Bitwise AND of Numbers Range
Bitwise AND of Numbers Range Given a range [m, n] where 0 <= m <= n <= 2147483647, return ...
- Windbg使用方法
hgy413的专栏 http://blog.csdn.net/hgy413/article/category/1143065
- 基于js利用经纬度进行两地的距离计算(转)
转自:http://www.storyday.com/html/y2009/2212_according-to-latitude-and-longitude-distance-calculation- ...
- linux系统yum方式安装htop命令[转]
CentOS下为yum加入rpmForge源,使用yum安装htop 为CentOS增加rpmForge软件源 wget http://pkgs.repoforge.org/rpmforge-rele ...
- windows 7 开启无线wifi
Windows 7 开启无线wifi步骤:1.选择“开始”-“运行”命令,在运行命令栏里输入“CMD”打开管理员: 2.在界面里输入以下命令:netsh wlan set hostednetwork ...
- 免费的UI素材准备
UI素材准备 UI也是一个专业性比较强的一个活啊,不过还好我有强大的百度,强大的百度有各种强大的网站,下面介绍一些UI常用的网站1.阿里巴巴矢量图标库 http://www.iconfont.cn/p ...
- OpenCV 学习笔记 02 处理文件、摄像头和图形用户界面
在处理文件前需要引入OpenCV库,同时也引入unmpy库 import cv2 import numpy as np 1 基本的读写操作 1.1 图像文件的读写操作 1.1.1 图像文件的读取操作 ...
- debian搭建本地镜像源
1. 安装apt-mirror apt-get install apt-mirror 2. 配置apt-mirror vim /etc/apt/mirror.list 2.1 下载目录什么的基础配置建 ...
- 关于try catch
说明try块中有return语句时,仍然会首先执行finally块中的语句,然后方法再返回. 如果try块中存在System.exit(0);语句,那么就不会执行finally块中的代码,因为Syst ...
- Android帧布局<TabHost>标签
先贴上一段代码: main.xml: <p><?xml version="1.0" encoding="utf-8"?> <Tab ...