I’m curious if I declare a column to be, say, varchar(5000) and then start creating rows, but leaving that column with null values, how is memory allocated? Is the DB growing by 5000 bytes for every row? Or does it wait to allocate memory until a value actually is set?
Share
you can find your answer here:
http://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html
NULL in MySQL (Performance & Storage)
How much memory will be occupied by a null value in a DB?
MySQL: How much space does a NULL field use?