In MySQL 5.1 InnoDB, does the maximum length of a VARCHAR affect secondary index size?
Posted
by
e_tothe_ipi
on Server Fault
See other posts from Server Fault
or by e_tothe_ipi
Published on 2012-06-21T00:05:37Z
Indexed on
2012/06/21
3:18 UTC
Read the original article
Hit count: 528
Assuming the data is the same either way, does the maximum length of the VARCHAR affect the space usage of a secondary index? Does InnoDB use fixed length records for indexes?
Assume that we're talking about MySQL 5.1, with the InnoDB COMPRESSED table format and that the field in question is defined as a VARCHAR with some length less than or equal to 255 (so that it uses only one byte for the offset).
Here is the use case:
I have a server with a very large table (several gigabytes). One of the fields is currently VARCHAR(7). We need it a little longer and we are thinking of making it VARCHAR(255), but we are worried that it bloat the index.
© Server Fault or respective owner