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

一文看懂MySQL如何查看數(shù)據(jù)庫表容量大小

數(shù)據(jù)庫 MySQL
今天主要介紹MySQL查看數(shù)據(jù)庫表容量大小的幾個方法,僅供參考。下面,我們一起來看。

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

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

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫', 
  3.     sum( table_rows ) AS '記錄數(shù)', 
  4.     sum( TRUNCATE ( data_length / 1024 / 1024, 2 ) ) AS '數(shù)據(jù)容量(MB)', 
  5.     sum( TRUNCATE ( 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ù)庫表容量大小

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ù)庫表容量大小

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

  1. SELECT 
  2.     table_schema AS '數(shù)據(jù)庫', 
  3.     sum( table_rows ) AS '記錄數(shù)', 
  4.     sum( TRUNCATE ( data_length / 1024 / 1024, 2 ) ) AS '數(shù)據(jù)容量(MB)', 
  5.     sum( TRUNCATE ( index_length / 1024 / 1024, 2 ) ) AS '索引容量(MB)'  
  6. FROM 
  7.     information_schema.TABLES  
  8. WHERE 
  9.     table_schema = 'mysql'

一文看懂MySQL如何查看數(shù)據(jù)庫表容量大小

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; 

責任編輯:趙寧寧 來源: 今日頭條
相關推薦

2019-09-17 07:31:53

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

2019-09-11 09:37:17

數(shù)據(jù)庫MySQL系統(tǒng)

2011-04-07 17:39:16

SQL Server數(shù)

2020-03-31 14:40:24

HashMap源碼Java

2024-12-04 13:02:34

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

2020-03-22 21:46:06

MySQLInnoDB表空間

2023-04-10 11:35:31

評估模型業(yè)務流程

2023-06-07 07:14:56

顯卡顯存容量

2021-10-17 19:48:10

擴展頁表虛擬機

2016-08-18 00:21:12

網(wǎng)絡爬蟲抓取網(wǎng)絡

2019-07-26 06:29:22

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

2023-12-26 07:40:34

2021-12-08 22:29:41

經(jīng)營分析體系

2024-08-12 12:30:27

2022-07-28 09:02:41

文件存儲系統(tǒng)

2020-01-03 09:00:00

數(shù)據(jù)庫數(shù)據(jù)庫管理金融

2019-12-02 11:13:38

數(shù)據(jù)庫觸發(fā)器SQLServer

2020-03-23 23:26:12

數(shù)據(jù)庫服務器優(yōu)化

2019-12-14 15:27:31

MySQL數(shù)據(jù)庫訪問控制

2025-01-20 09:15:00

iOS 18.3蘋果iOS 18
點贊
收藏

51CTO技術棧公眾號