MySQL Forums
Forum List  »  Performance

Re: VARCHAR performance
Posted by: Øystein Grøvlen
Date: March 07, 2014 08:48AM

Hi,

> What do I have to do to use a VARCHAR bigger than 170 and still avoid temporary
> tables going to disk.

The short answer is: Use MySQL 5.6.15 or later

In MySQL 5.6.15, the maximum length of columns to be stored in MEMORY tmp table is 512 characters. Before that, the maximum length was 512 bytes. This implied that for columns using utf8, the max length was 512/3 = 170 characters. (In other words, if you switch to latin1 you will also be able to use a larger size.)

The reason there is a limit, is that MEMORY storage engine does not handle variable length columns. Hence, long VARCHAR columns can not be efficiently stored.

Hope this helps,

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
1962
March 06, 2014 05:15AM
Re: VARCHAR performance
908
March 07, 2014 08:48AM
878
March 07, 2014 10:01AM
850
March 07, 2014 10:13AM
756
March 07, 2014 10:57AM
976
March 08, 2014 12:53PM


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.