I have created the following MySQL table, which stores which sections of our site a user visited (and the
Count of visits):
CREATE TABLE `Visits` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `User` int(10) unsigned NOT NULL, `EventKind` enum('search','purchase','subsectionList','event','like','superprice','toursList','abonementsList','abonement') NOT NULL, `SiteSection` enum('section','subsection','superprice','region','city','children','tour','abonement') NOT NULL, `Object` int(10) unsigned NOT NULL DEFAULT '0', `Count` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), KEY `User` (`User`), KEY `EventKind` (`EventKind`), KEY `SiteSection` (`SiteSection`), KEY `Object` (`Object`) ) ENGINE=MyISAM;
The quadruple User/EventKind/SiteSection/Object is always unique. My question: Is it worth (especially due performance considerations) to add a 4-columns UNIQUE key?
This data will be used to show a user these sections of the site which are related with his previous visits.