I see that VARCHAR (255) is used all the time instead of VARCHAR (256), but I also use VARCHAR (16) instead of VARCHAR (15). It seems inconsistent to me. If an extra byte is used to store the VARCHAR length, should this rule not apply to smaller sizes, for example, 2, 4, 8 instead of 1, 3, 7?
Or am I missing something?
In other words, if I have a number that I know will never be higher than 12, should I go further and use VARCHAR (15) or VARCHAR (16) instead? Because it uses the same space as VARCHAR (12)? If so, which one am I using? 15 or 16? Does this rule change at all when I approach 256?
I use MySQL and SQL, depending on the project.
source share