MySQL 8.0.27 introduced a new variable to
control the maximum of parallel threads InnoDB can use for
creating (sorting and building) secondary indexes: innodb_ddl_threads
.
This new variable is coupled with another new variable:
innodb_ddl_buffer_size
.
If you have fast storage and multiple CPU cores, tuning these variables can speed up secondary index creation.
For this example, I used the airportdb database, and I added a
secondary index to the largest table, booking
.
Let’s start with the default settings:
SQL alter table booking …[Read more]