作成したテーブル
mysql> show create table test01 \G
CREATE TABLE `test01` (
`id` int(11) NOT NULL
auto_increment,
`id1` int(11) NOT NULL,
`id2` int(11) NOT NULL,
`id3` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `test01_UNQ_1` (`id1`),
UNIQUE KEY `test01_UNQ_2` (`id2`,`id3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
mysql> show create table test02 \G
CREATE TABLE `test02` (
`id` int(11) NOT NULL
auto_increment,
`id1` int(11) NOT NULL,
`id2` int(11) NOT NULL,
`id3` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `test02_UNQ_1` (`id1`),
UNIQUE KEY `test02_UNQ_2` (`id2`,`id3`),
KEY `test02_FK_1` (`id2`),
CONSTRAINT `test02_FK_1`
FOREIGN KEY (`id2`)
REFERENCES `test01` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
mysql> show create table test03 \G
CREATE TABLE `test03` (
`id` int(11) NOT NULL auto_increment,
`id1` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `test03_UNQ_1` (`id1`),
CONSTRAINT `test03_FK_1`
FOREIGN KEY (`id1`)
REFERENCES `test01` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
■結果
●正しく unique になるもの
・test01_UNQ_1 単独
・test01_UNQ_2 複合
・test02_UNQ_1 単独
・test03_UNQ_1 単独、FK
●index になるもの
・test02_UNQ_2 複合、FK
■まとめ
ということで、複合UNIQUE制約且つ、対象列がFKとしても定義されている場合に、index になっている様子です。