This is more a habit than anything. There is nothing magic in varchar (32) or varchar (64), nor is there anything magic in the default values that visual tools try to force you to use (e.g. varchar (50)). Many of these upper bounds were rooted in people's heads, since 640k will have enough memory for everyone, and we really need to worry about every byte.
In many cases, it comes down to a general concept. In the previous system, I worked in product managers, and had no idea what their requirements were. They wanted to keep the name, but they did not know what the name domain consists of, but one of them said that they had heard about the surname> 50 characters, so he knew that there should be more than 32 and more than 50. We returned from 64, he agreed that this is enough, and that AFAIK still exists.
Although we had a technical reason for email (varchar (320)), which at the time the standard dictated 320 characters, because 64 characters for the username / local part, 255 characters for the domain name and 1 character for @, Most other solutions were based on priority (for example, all subsequent names corresponded to the nvarchar (64) model, as was decided above) or logic (for example, URLs should not be nvarchar (max), but depending on the standard and browser capabilities on ( 2048) or varchar (4096), in this case not because it was power 2 but because other software or standards built their things to use power 2.
Aaron bertrand
source share