自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳解MySQL查看數(shù)據(jù)庫表容量大小的方法總結(jié)

數(shù)據(jù)庫 MySQL
今天主要介紹MySQL查看數(shù)據(jù)庫表容量大小的幾個(gè)方法,僅供參考。

[[276918]]

概述

今天主要介紹MySQL查看數(shù)據(jù)庫表容量大小的幾個(gè)方法,僅供參考。

1、查看所有數(shù)據(jù)庫容量大小

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫'
  3.     sum( table_rows ) AS '記錄數(shù)'
  4.     sumTRUNCATE ( data_length / 1024 / 1024, 2 ) ) AS '數(shù)據(jù)容量(MB)'
  5.     sumTRUNCATE ( index_length / 1024 / 1024, 2 ) ) AS '索引容量(MB)'  
  6. FROM 
  7.     information_schema.TABLES  
  8. GROUP BY 
  9.     table_schema  
  10. ORDER BY 
  11.     sum( data_length ) DESC
  12.     sum( index_length ) DESC

詳解MySQL查看數(shù)據(jù)庫表容量大小的方法總結(jié)

2、查看所有數(shù)據(jù)庫各表容量大小

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫'
  3.     table_name AS '表名'
  4.     table_rows AS '記錄數(shù)'
  5.     TRUNCATE ( data_length / 1024 / 1024, 2 ) AS '數(shù)據(jù)容量(MB)'
  6.     TRUNCATE ( index_length / 1024 / 1024, 2 ) AS '索引容量(MB)'  
  7. FROM 
  8.     information_schema.TABLES  
  9. ORDER BY 
  10.     data_length DESC
  11.     index_length DESC
詳解MySQL查看數(shù)據(jù)庫表容量大小的方法總結(jié)

3、查看指定數(shù)據(jù)庫容量大小

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫'
  3.     sum( table_rows ) AS '記錄數(shù)'
  4.     sumTRUNCATE ( data_length / 1024 / 1024, 2 ) ) AS '數(shù)據(jù)容量(MB)'
  5.     sumTRUNCATE ( index_length / 1024 / 1024, 2 ) ) AS '索引容量(MB)'  
  6. FROM 
  7.     information_schema.TABLES  
  8. WHERE 
  9.     table_schema = 'mysql'
詳解MySQL查看數(shù)據(jù)庫表容量大小的方法總結(jié)

4、查看指定數(shù)據(jù)庫各表容量大小

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫'
  3.     table_name AS '表名'
  4.     table_rows AS '記錄數(shù)'
  5.     TRUNCATE ( data_length / 1024 / 1024, 2 ) AS '數(shù)據(jù)容量(MB)'
  6.     TRUNCATE ( index_length / 1024 / 1024, 2 ) AS '索引容量(MB)'  
  7. FROM 
  8.     information_schema.TABLES  
  9. WHERE 
  10.     table_schema = 'mysql'  
  11. ORDER BY 
  12.     data_length DESC
  13.     index_length DESC
詳解MySQL查看數(shù)據(jù)庫表容量大小的方法總結(jié)

 


 

責(zé)任編輯:龐桂玉 來源: 今日頭條
相關(guān)推薦

2019-09-17 08:23:35

MySQL數(shù)據(jù)庫容量

2011-04-07 17:39:16

SQL Server數(shù)

2010-10-15 16:20:59

MySQL數(shù)據(jù)庫表

2011-07-18 15:59:17

MySQL數(shù)據(jù)庫

2011-08-25 17:49:14

MySQLmysqlcheck

2017-09-27 09:36:22

數(shù)據(jù)庫基礎(chǔ)技巧數(shù)據(jù)庫大小

2010-11-16 11:17:41

Oracle表空間大小

2010-04-14 13:14:46

Oracle數(shù)據(jù)庫

2011-05-24 14:55:01

Oracle數(shù)據(jù)庫

2010-11-23 11:04:25

查看MySQL數(shù)據(jù)庫

2010-10-13 11:54:00

MySQL數(shù)據(jù)庫表

2019-01-02 11:10:40

MySQL數(shù)據(jù)庫數(shù)據(jù)庫設(shè)計(jì)

2016-12-29 12:24:33

MySQL數(shù)據(jù)庫移植

2010-10-28 14:18:01

oracle數(shù)據(jù)庫版本

2011-04-12 14:48:38

MySQL數(shù)據(jù)庫

2011-04-12 10:09:33

Oracle數(shù)據(jù)庫關(guān)閉

2011-08-05 14:31:04

mysql_conve批量轉(zhuǎn)換MYSQL數(shù)據(jù)MYISAM

2010-09-08 16:03:57

SQL臨時(shí)表數(shù)據(jù)庫

2009-03-30 14:19:26

優(yōu)化數(shù)據(jù)庫MySQL

2019-07-11 08:45:00

MySQL數(shù)據(jù)庫緩存
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號