InnoDB indexes are
B-trees where the index
records are stored in the leaf pages of the tree. The default
size of an index page is 16KB. When new records are inserted,
InnoDB tries to leave 1/16 of the page free
for future insertions and updates of the index records.
If index records are inserted in a sequential order (ascending or descending), the resulting index pages are about 15/16 full. If records are inserted in a random order, the pages are from 1/2 to 15/16 full.
As of As of MySQL 5.7.5,
InnoDB performs a
bulk load when creating or rebuilding indexes. This method of
index creation is also known as a sorted index build.
innodb_fill_factor defines the
percentage of space on each B-tree page that is filled during a
sorted index build, with the remaining space reserved for future
index growth. For more information, see
Section 14.12.17, “Bulk Load for CREATE INDEX”.
If the fill factor of an index page drops below the
MERGE_THRESHOLD, which is 50% by default if
InnoDB tries to contract the
index tree to free the page. For more information, see
Section 14.12.18, “Configuring the Merge Threshold for Index Pages”.
You can specify the page
size for all
InnoDB tablespaces in a
MySQL instance by setting the
configuration option before creating the instance. Once the
page size for a MySQL instance is set, you cannot change it.
Supported sizes are 64KB, 32KB, 16KB (default), 8KB, and 4KB,
corresponding to the option values
Support for 32KB and 64KB pages sizes was added in MySQL
5.7.6. For more information, refer to the
A MySQL instance using a particular
page size cannot use data files or log files from an instance
that uses a different page size.