Skip to content

Instantly share code, notes, and snippets.

@iflamed
Created March 10, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iflamed/6da2d177f754f6633e69503d1f1a5c24 to your computer and use it in GitHub Desktop.
Save iflamed/6da2d177f754f6633e69503d1f1a5c24 to your computer and use it in GitHub Desktop.
数据表碎片优化
select concat('optimize table ',table_schema,'.',table_name,';'),data_free,engine
from information_schema.tables
where data_free>0 and engine !='MEMORY'
ORDER BY data_free DESC ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment