Bug #17042 Index limits too small to be useful in multibyte environments
Submitted: 2 Feb 2006 15:05 Modified: 4 Oct 2008 18:33
Reporter: Kristian Koehntopp Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.18 (MySQL download) OS:Any (any Linux)
Assigned to: CPU Architecture:Any

[2 Feb 2006 15:05] Kristian Koehntopp
Description:
The index length limit for InnoDB is 767 byte, for MyISAM it is 1024 bytes.

In a utf8/multibyte environment that comes down to 256/341 characters for an index, which is very small.

I am currently with the United Nations FAO in Rome, Italy. This organisation has 5 official languages, including arabic and chinese - UTF8 is an absolute requirement.

How to repeat:
root@localhost [cds_onefish]> show create table search_hits\G
*************************** 1. row ***************************
       Table: search_hits
Create Table: CREATE TABLE `search_hits` (
  `hits` int(6) NOT NULL,
  `ref_date` datetime NOT NULL,
  `search_utf8` varchar(512) character set utf8 collate utf8_bin NOT NULL,
  PRIMARY KEY  (`ref_date`,`search_utf8`(200))
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

Table definition originally on Oracle, converted using the Migration Toolkit. PRIMARY KEY definiton had to be changed manually from PRIMARY KEY (`ref_date`, `search_utf8`) to the shown definition for the migration to work. There is a lot of more tables with similar problems (a few thousand tables in 322 schema definitions).

Suggested fix:
For this to be useful, the index length limits should be able to match the VARCHAR lengths provided even if the VARCHARs are UTF8 all the way.

I know that this is not efficient, but that is not the issue of the migration project, it is an issue for the followup performance tuning project.
[3 Jun 2006 14:22] Valeriy Kravchuk
This sounds like a reasonable feature request for me.
[15 Mar 2007 10:48] Ingo Strüwing
Many users are crying for this feature. Some even think it's a bug to have this limited size. Please see Bug#4541.
[4 Oct 2008 18:33] Konstantin Osipov
This is a duplicate of Bug#4541