I have a table with several hundred million rows. One of the columns is `status` varchar(10).
Most values in the status are 1 character, some varying up to 10. However a subset of the values has a pattern of its own. A whole group of status values begin with a single character c followed by a number ranging from 0 to 10,000.
I would like to index this column with the following:
ALTER TABLE tbl ADD KEY (status(1), status);
This would be better than having two individual keys, one on status(1) (first character of the whole column) and second status. Together they would always be faster.
However MySQL prohibits me from creating such:
ERROR 1060 (42S21): Duplicate column name 'status'
How can I solve this?