MySQL Forums
Forum List  »  InnoDB

Re: MySQL 5.5 vs 5.6 character set issue
Posted by: Rick James
Date: August 31, 2013 02:56PM

You have raised several issues.

* Defaults changing. Well, that does happen. Protect yourself by explicitly specifying things -- CHARACTER SET latin1 (or utf8, etc) can be put on CREATE DATABASE, CREATE TABLE, and/or a column in a table.

* For practical reasons, there is a limit on the size of an each index. If you need a non-UNIQUE index, use a 'prefix', eg: INDEX vchar_col(50). (There are pros and cons of taking that approach.) If you need a UNIQUE index, that is, you desire a uniqueness constraint, you could either do it in your code, or have another column with the MD5 of that varchar. Then have a UNIQUE index on that column. (Again, there are pros and cons.)

* Performance of wide indexes -- well, that is essentially why the limits exist.

* "multibyte" -- latin1: 1 byte per character; utf8: up to 3 bytes per character ("3" is used in certain situations, such as index creation, to provide an upper bound); utf8mb4: up to 4 bytes per character (this charset was added to account for some newer Chinese characters).

* "large key" parameter -- I would look for other solutions (as mentioned above) first. Would you care to elaborate on the field's purpose and whether the index needs to be UNIQUE?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MySQL 5.5 vs 5.6 character set issue
1411
August 31, 2013 02:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.