I believe the key settings you should look at are key_buffer_size
, myisam_max_sort_file_size
and myisam_sort_buffer_size
. key_buffer_size
is one of the most important settings overall for MyISAM, but the other two might need some explanation.
From http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html:
myisam_max_sort_file_size
The maximum size of the temporary
file that MySQL is allowed to use
while re-creating a MyISAM index
(during REPAIR TABLE, ALTER TABLE, or
LOAD DATA INFILE). If the file size
would be larger than this value, the
index is created using the key cache
instead, which is slower. The value is
given in bytes.
The default value is 2GB. If MyISAM
index files exceed this size and disk
space is available, increasing the
value may help performance.
myisam_sort_buffer_size
The size of the buffer that is
allocated when sorting MyISAM indexes
during a REPAIR TABLE or when creating
indexes with CREATE INDEX or ALTER
TABLE.
The maximum allowable setting for
myisam_sort_buffer_size is 4GB.
So basically, if you expect your indexes to be larger than myisam_max_sort_file_size
, you might want to look at tweaking that up. If not, the myisam_sort_buffer_size
might warrant some attention.
Keep in mind that creating indexes on a MyISAM table locks the entire table. If you're doing this constantly on large tables, you could have some serious performance issues, no matter how many settings you tweak.