I have the following MySQL/InnoDB table. I added a compound index as the primary key on both columns, and I have also added two single column indexes. With the compound index in place am I getting any performance increase from the single column indexes? or would I be better to drop them?
CREATE TABLE `keywords` (
`keyword` varchar(100) NOT NULL,
`record_id` int(11) NOT NULL,
PRIMARY KEY (`keyword`,`record_id`),
KEY `keyword` (`keyword`),
KEY `record_id` (`record_id`),
CONSTRAINT `keywords_record_id_records_id` FOREIGN KEY (`record_id`) REFERENCES `records` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
If it helps, the main purpose of this table is as a forward index, so this table is exclusively used with record_id INNER JOIN
ed to the id column of my main record table.