I've seen a few people link to an INFORMATION_SCHEMA query to be able to find any indexes that have low cardinality, in an effort to find out what indexes should be removed. This method is flawed - here's the first reason why:
PLAIN TEXT SQL:
- CREATE TABLE `sales` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `customer_id` int(11) DEFAULT NULL,
- `status` enum('archived','active') DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `status` (`status`)
- ) ENGINE=MyISAM AUTO_INCREMENT=65691 DEFAULT CHARSET=latin1;
- mysql> SELECT count(*), STATUS FROM sales GROUP BY STATUS;
- +----------+---------+
- | count(*) | STATUS |
- +----------+---------+
- | 65536 | archived | …