I'm trying to create indexes on large MySQL tables (50-100GB per table).
I noticed that when the ALTER statement is initiated to create a new index, MySQL creates several temp files for that table, copying the entire table data (.MYD file) and index (.MYI file) to new files, probably modifying them accordingly and at the end swapping them with the original files. This process takes a lot of time, as it needs to copy a lot of data to those temp files.
Assuming I don't care about locking the table / downtime / any other production related limitation, is there a quicker way? Is there a way to tell MySQL, don't create those large temp files, but just create the index as fast as you can?