My Oracle Support Banner

InnoDB Table Fragmentation and Defragmentation, Free Space, Within MySQL Server (Doc ID 1338611.1)

Last updated on MAY 30, 2023

Applies to:

MySQL Server - Version 4.0 and later
Information in this document applies to any platform.


Check whether InnoDB tables are fragmented and optimise them if desired.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Types of fragmentation
 1. Fragmentation within the filesystem when using innodb_file_per_table.
 2. Fragmentation within the shared tablespace, mainly if not using innodb_file_per_table
 3. Fragmentation of the data rows in the clustered index.
 4. Fragmentation within unique secondary index pages.
 5. Fragmentation within non-unique secondary index pages.
 6. Fragmentation of partitions
 7. Free space
 Combined defragmentation for all causes.

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.