I have tried making two database tables wp_marketing and wp_email. I have a problem of redundant indexes in these tables. I have added the SHOW CREATE TABLE tablename;.
CREATE TABLE `cur_emailcontent` (
`title` varchar(100) NOT NULL,
`message` varchar(1000) NOT NULL,
`mail_from` varchar(100) NOT NULL,
`subject` varchar(100) NOT NULL,
KEY `title` (`title`),
CONSTRAINT `cur_emailcontent_ibfk_1` FOREIGN KEY (`title`) REFERENCES `cur_marketing` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Initially i made title column as primary, then I changed the Index Type of the same to INDEX. Now I can use any other column to be as PRIMARY KEY but I cannot delete this index using PHPMyAdmin but was unable to do so.I got to know that these types of indexes are called redundant indexes.
Now I don’t have any option other than creating the table(s) again. Is there any solution to such indexes?
If querying
cur_emailcontenttable based ontitleis very unlikely and don’t want it to be a foreign key either; also to havemail_fromas new primary key just execute:MySQL Alter Syntax