查询数据库的占用

SELECT CONCAT(ROUND(SUM(index_length)/(1024*1024), 2), ' MB')
AS 'Total Index Size'
, CONCAT(ROUND(SUM(data_length)/(1024*1024), 2), ' MB') AS 'Total Data Size'
FROM information_schema.TABLES
where table_schema like 'edb_a%' ;

 

查询表的占用

SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name',
CONCAT(ROUND(table_rows/1000000,2),'M') AS 'Number of Rows',
CONCAT(ROUND(data_length/(1024*1024*1024),2),'G') AS 'Data Size',
CONCAT(ROUND(index_length/(1024*1024*1024),2),'G') AS 'Index Size' ,
CONCAT(ROUND((data_length+index_length)/(1024*1024*1024),2),'G')
AS'Total'FROM information_schema.TABLES
WHERE table_schema LIKE 'edb_a%';

相关文章:

  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2021-06-24
  • 2021-06-26
猜你喜欢
  • 2022-01-26
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
相关资源
相似解决方案