sql - Character Column Lengths -
What are some good rules of thumb to specify the column length? People will use "VAARAAR (50)" arbitrarily for name fields, etc. ... but most of these guess. Does anyone have any resources they use? What are the rules of thumb that you determine the length of a character? For example, for a URL - it can be for a long time, especially given the maximum length quickstring - but using VARCHAR (MAX) at the top, VARCHAR will only take the necessary string of actual string data. .
Please advise / share -
things like URLs and e-mail addresses For RFC can be useful URL has a limit of 2083, whereas the maximum e-mail address is 320 characters (for name 64, for domain @ 1 and 255). Generally, I mistake the user data stored on behalf of something like 'too long'. For internal use, I try to be more restrictive, I usually use 50 for keys, 255 for description, and even further. You will not be able to see much impact on the performance, unless you are searching or doing nothing, many of these options come into your personal preference.
In short:
- There is a specification for this data (URL, e-mail address, etc.): be accurate
- User data : Lets go for things like name, set a reasonable limit for things like comment text
- Internal use: whichever boat your boat swings
Comments
Post a Comment