Based on background C, I may be too anal about this and without too much worry about bits and bytes.
However, I cannot understand how the data is actually stored, and that if I choose N, which is easily factorized to the power of 2, the database will be more efficient in how it packs the data, etc.
Using this βlogicβ, I have a string field in a table with a variable length of up to 21 characters. I am tempted to use 32 instead of 21 for the reason mentioned above, however now I think I am wasting disk space because there will be space for 11 extra characters that are guaranteed to never be used. Since I plan to store several tens of thousands of lines per day, all this adds up.
Question:
Keeping all of the above in mind, Should I declare varchar (21) or varchar (32) and why?
[change]
The stored data conforms to an external specification and cannot be longer than 21 characters. I use both mySQL and PostgreSQL, but ideally I want the answer to be a database agnostic, as I try not to bind to any particular provider.
source
share