Possible Duplicate:
MySQL: Large VARCHAR vs. TEXT?
Since VARCHAR can have 65k bytes now, when then should TEXT be used instead of VARCHAR?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A long
VARCHARis stored in the same manner as aTEXT/BLOBfield inInnoDB.source
Unless you need to index these columns (in which case
VARCHARis much faster) there is no reason to useVARCHARoverTEXTfor long fields – there are some engine specific optimisations inMySQLto tune the data retrieval according to length, and you should use the correct column type to take advantage of these.In case you’re using
MyISAMan in-depth discussion on the topic is here.TEXTandBLOBare stored off the table with the table just having a pointer to the location of the actual storage.VARCHARis stored inline with the table.VARCHARis faster when the size is reasonable.According to this test,
VARCHARis about thrice as fast as text.