update
This commit is contained in:
		@@ -49,3 +49,18 @@ optimize table song;
 | 
			
		||||
optimize table song_album_relation;
 | 
			
		||||
optimize table song_artist_relation;
 | 
			
		||||
optimize table user;
 | 
			
		||||
 | 
			
		||||
-- 查询单个数据库里面各个表所占磁盘空间大小包括其索引的大小
 | 
			
		||||
SELECT
 | 
			
		||||
    table_schema AS '数据库',
 | 
			
		||||
    table_name AS '表名',
 | 
			
		||||
    table_rows AS '记录数',
 | 
			
		||||
    TRUNCATE (data_length / 1024 / 1024, 2) AS '数据容量(MB)',
 | 
			
		||||
    TRUNCATE (index_length / 1024 / 1024, 2) AS '索引容量(MB)',
 | 
			
		||||
    TRUNCATE ((data_length + index_length) / 1024 / 1024 / 1024, 2) AS '总容量(GB)'
 | 
			
		||||
FROM
 | 
			
		||||
    information_schema.TABLES
 | 
			
		||||
WHERE
 | 
			
		||||
    table_schema = 'neteasemusic'
 | 
			
		||||
ORDER BY
 | 
			
		||||
    table_rows DESC;
 | 
			
		||||
		Reference in New Issue
	
	Block a user