I'm designing a MySQL table that will contain a row which contains a subject title of variable length, but probably between 40-100 characters. VARCHAR is the obvious choice, but I'm not clear on how to balance efficiency with ensuring that I capture all data. I can declare it as VARCHAR(256) and be very safe, or I can declare it as VARCHAR(512) and be crazy safe. From what I understand, VARCHAR only stores what you put in it, so why don't we just use VARCHAR(max) all the time? Is it just to protect against running over the 65,535 byte row size limit, which includes all columns in the row? What's the best design practice when you have a general idea about the upper limit of a string's length like this?
Some people don't understand the question. I'm asking what the reason is to specify a limit on VARCHAR that isn't max. I know what a VARCHAR is, what max is, etc.