title: Keys are reported as redundant, but are they really?
body: <p>I am trying to optimize the schemas for tables by removing redundant keys. Both the percona toolkit and common_schema tell me that the following key is redundant:</p>
  
  <pre><code>mysql&gt; SELECT redundant_index_name, sql_drop_index FROM redundant_keys;
  +----------------------+-------------------------------------------------------------------------------+
  | redundant_index_name | sql_drop_index                                                                |
  +----------------------+-------------------------------------------------------------------------------+
  | deviceName           | ALTER TABLE `reporting`.`tbCardData` DROP INDEX `deviceName`         |
  +----------------------+-------------------------------------------------------------------------------+
  1 rows in set (0.18 sec)
  
  mysql&gt; show create table `reporting`.`tbCardData`;
  
  CREATE TABLE `tbCardData` (
    `pkCardDataId` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
    `deviceName` varchar(64) DEFAULT NULL,
    `shelfId` smallint(3) unsigned DEFAULT NULL,
    `cardId` smallint(3) unsigned DEFAULT NULL,
    `cardName` varchar(64) DEFAULT NULL,
    `cardType` smallint(3) unsigned DEFAULT NULL,
    `cardSubType` smallint(3) unsigned DEFAULT NULL,
    `cardSpareGroupId` smallint(3) unsigned DEFAULT NULL,
    `cardSerialNum` varchar(64) DEFAULT NULL,
    `cardCarrierSerialNum` varchar(64) DEFAULT NULL,
    `dom` tinyint(2) unsigned NOT NULL DEFAULT '0',
    `updateTime` int(11) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`pkCardDataId`),
    UNIQUE KEY `devchascarddom` (`deviceName`,`shelfId`,`cardId`,`dom`),
    KEY `deviceName` (`deviceName`),
    KEY `dom` (`dom`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>I understand that deviceName Key and the unique key devchascarddom share the leftmost attribute, deviceName, but it would seem to me that the Unique Key occurs once, whereas there are several deviceNames in the list. I guess what i am saying is, dropping the Key deviceName doesn't seem to make sense to me here, but i am no mysql guru -- should i drop it or is this just the way these tools are reporting back to me that i'll have to discard?</p>