MySQL Forums
Forum List  »  InnoDB

Re: Avoid fragmentation for Mysql tables
Posted by: Peter Brawley
Date: August 23, 2017 12:14AM

InnoDB stores data in a tree, reusing space from deletions.

This query estimates fragmentation ...

select engine, table_name,round( data_length/1024/1024) as data_length ,
round(index_length/1024/1024) as index_length,
round(data_free/ 1024/1024) as data_free,
(data_free/(index_length+data_length)) as frag_ratio
from information_schema.tables
where data_free > 0
order by frag_ratio desc;

I don't often see values much over 5%. But see

How to defragment:

Options: ReplyQuote

Written By
August 22, 2017 10:02PM
Re: Avoid fragmentation for Mysql tables
August 23, 2017 12:14AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.