Why MySQL multiple-column index is overpopulated?
- by actual
Consider following MySQL table:
CREATE TABLE `log`
(
`what` enum('add', 'edit', 'remove') CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`with` int(10) unsigned NOT NULL,
KEY `with_what` (`with`,`what`)
) ENGINE=InnoDB;
INSERT INTO `log` (`what`, `with`) VALUES
('add', 1),
('edit', 1),
('add', 2),
('remove', 2);
As…