code_junkie

How wrong is it to have a unique and normal index on the same column?

Nov 12th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. CREATE TABLE `table` (
  2. `id` int(11) NOT NULL auto_increment,
  3. `date_expired` datetime NOT NULL,
  4. `user_id` int(11) NOT NULL,
  5. `foreign_id` int(11) NOT NULL,
  6. PRIMARY KEY (`id`),
  7. UNIQUE KEY `date_expired` (`date_expired`,`user_id`,`foreign_id`),
  8. KEY `user_id` (`user_id`)
  9. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Add Comment
Please, Sign In to add comment