MySQL Server does not require you to specify name of the index if you're running ALTER TABLE statement - it is optional. Though what might be good practical reasons to specify the key name or omit ?
Things what you should be looking at is how MySQL names indexes automatically as well as what maintaining the indexes.
Lets first speak about naming. If you do not specify index name MySQL will name index by the first column of index created, if there is such index already it will add numeric suffix to it, for example:
PLAIN TEXT SQL:
- mysql> CREATE TABLE t1(i int, j int);
- Query OK, 0 rows affected (0.01 sec)
- mysql> ALTER TABLE t1 ADD KEY(i,j);
- Query OK, 0 rows affected (0.03 sec)
- Records: 0 Duplicates: 0 Warnings: 0
- mysql> ALTER TABLE t1 ADD KEY(i); …