And if so, why? I mean, is a tinyint faster to search than int?
If so, what are the practical differences in 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.
Depending on the data types, yes, it does make a difference.
intvs.tinyintwouldn’t make a noticeable difference in speed, but it would make a difference in data sizes. Assumingtinyintis 1 byte, versusintbeing 4, that’s 3 bytes saved every row. it adds up after awhile.Now, if it was
intagainstvarchar, then there would be a bit of a drop, as things like sorts would be much faster on integer values than string values.If it’s a comparable type, and you’re not very pressed for space, go with the one that’s easier and more robust.