MariaDB : Faster Index Creation. :: I've had to create indexes for tables with hundreds of millions records in it. Anyone who has tried it will already knew the pain :)

With MariaDB, you can have this process done faster. Here's the settings that you'll need to set :


Ensure these 2 variables are bigger than each index that's going to be created. In a server with 128 GB of RAM, I set this to 50 GB. Indexes are always created very quickly :)

Otherwise, the index creation process will show as "Repair with keycache". This is really slow. 

When these 2 variables are set with big enough numbers, then you'll see "Repair by sorting", or, when you set the following variable : "Repair with X threads" 


When this variable is bigger than 1, MariaDB will utilize more than 1 cpu core in the index creation process. 

The bigger the number, more cpu core may be used, so it'll be potentially faster. However, this will result in more usage of cpu (of course) and RAM. 

NOTE: using this setting in MySQL is not advised, there are still bugs :

Hope this helps someone else.
Shared publicly