Is it better to store an integer UserID or store Username as the key.
Which is better for performance?
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.
The questions seems more like a discussion because it’s really based on application requirements. However, I will give a general answer why UserID is better for performance.
My 3 reasons why UserID is better for performance:
INTdata type only requires up to 4 bytes allowing up to 4294967295 unique idsMy 3 reasons not to use Username:
latin1MyISAMtable with fixed-width tables. A fixed-width table onMyISAMgives you a 30% increase in lookup speed versus a dynamic table.MyISAMdoes table level locking which can cause slower performance if table is a heavywrite.