MySQL INT(1) or INT(10)
In short, it really doesn’t matter. After watching a MySQL web conference by Jay Pipes, I was gutted when I found out that they are actually exactly the same. I know im not alone in thinking that it affected the size of the data field. An unsigned int has the max value of 4294967295 no matter if its INT(1) or int(10) and will use 4 bytes of data.
So, what does the number in the brackets mean? It pretty much comes down to display, its called the display-width. The display width is a number from 1 to 255. You can set the display width if you want all of your integer values to “appear”. If you enable zerofill on the row, the field will have a default value of 0 for int(1) and 0000000000 for int(10).
There are 5 main numeric data types, and you should choose each one on its own merits. Based on the data you expect (or in some cases hope) to hold, you should use the correct data type. If you dont ever expect to use a value of above 127 and below -128, you should use a tinyint. This will only use 1 byte of data, which may not seem like much of a difference between the 4 used by an int, but as soon as you start to store more and more data, the effect on speed and space will be noticable.
Anyway, I thought I should share my new found knowledge of the display width with everyone, because it will save me thinking its optimising stuff changing from 10 to 5, haha.











Just what I was looking for. Thanks for the clear explanation!
I never knew that! Every day’s a school day!
brilliant!
i was always under the assumption that this affected the data inside the column in some way!
thank you kindly for the clear and precise description!
thanks for the information!
haven’t knew it yet, but is pretty nice to know
thanks for the explanation!
Cool post. Google’d what int(10) meant and found your post right away. Thanks for ur knowledge
I suspected as such, thanks for clearly defining it for me.
Thanks, new thing for me as i was in wrong assumption about INT(4) and INT(10)
Thanks buddy…!!
thanks for the display width info..
Many thanks for your clear explanation..