Hi,
I noticed that in MySQL, both VARCHAR and TEXT offer variable-sized data. Well, VARCHAR is a bit more efficient in data storage, but still, TEXT MEDIUMTEXT and LONGTEXT offer a lot more potential. So, what are the real uses of VARCHAR?
Hi,
I noticed that in MySQL, both VARCHAR and TEXT offer variable-sized data. Well, VARCHAR is a bit more efficient in data storage, but still, TEXT MEDIUMTEXT and LONGTEXT offer a lot more potential. So, what are the real uses of VARCHAR?
First of all, you should read the 10.4. String Types section of the MySQL's manual : it'll give you all the informations you are looking for :
A couple of important differences :
max_sort_length
bytes of the column are used when sorting."
Considering these informations, if you are sure that your strings will not be too long, and that you'll always be able to store them in a varchar, I would use a varchar.