OPTIMIZE TABLE TableName; -- 优化表碎片(会锁表,数据量大的表执行时间相对较长)

show table status from database_test like 'TableName'; -- 查询表状态

SELECT table_schema,TABLE_NAME , concat(data_free/1024/1024,"M") FROM `information_schema`.tables WHERE data_free >8*1024*1024 AND ENGINE ='innodb' ORDER BY data_free DESC; -- 查询表碎片空间占用较大的表

相关文章:

  • 2021-08-28
  • 2021-12-23
  • 2022-01-26
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2021-12-11
  • 2021-11-09
  • 2022-12-23
  • 2021-05-16
相关资源
相似解决方案