Today, an index is added to a large MyISAM table. The size of the temporary MYD file is very slow. After the MYD file is created, it is found that the MYI file is very small and the ALTERTABLE statement cannot end, log on to MYSQL to view showprocesslist. The ALTERTABLE statement is in the "Repairwithkeycache" status.
Today, an index is added to a large MyISAM TABLE. The size of the temporary MYD file is very slow. After the MYD file is created, it is found that the MYI file is very small and the alter table statement cannot end, log on to MYSQL and check show processlist. The alter table statement is displayed inRepair with keycache"Status.
So we thought that the myisam_max_sort_file_size parameter was set to 10 Gb, but now the file is just a little bit larger than 10 Gb, so we cannot use the directory Sorting index specified by tmpdir. Therefore, add the myisam_max_sort_file_size parameter to 20 GB and alter table again. First, the MYD file is created much faster. After the MYD file is created, the MYI file starts to grow. View processlist, we found thatRepair by sorting"Status. The table is created soon.
If you encounter a similar situation, you can try it.