InnoDB and fragmentation


I am lost trying to find out whether or not there is a way to measure fragmentation on InnoDB tables. The idea is not to rebuild tables where it is not needed.

Do you know the magic formula ?

Thank you

What version of MySQL are you running?
Since you need something like the Percona innodb_check_fragmentation patch if you are going to be able to see it.

Use xtrabackup with stats if you can’t use Percona Server.