A really quick one – is it more efficient to store data which might be one or two characters as CHAR(2) or VARCHAR(2) in MySql?
Thanks!
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.
In terms of storage space required, you’re better off with CHAR(2) because the VARCHAR(2) type will require one extra byte to store the length:
See 10.4.1. The CHAR and VARCHAR Types for more details.
More Information: What's the difference between VARCHAR and CHAR?