title: Memory usage of storing strings as varchar in MySQL
body: <p>I've begun to get very interested in the memory usage of MySQL. So I'm looking at this here:</p>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html</a></p>
  
  <p>I get very excited about the prospect of saving memory by (for example) needing only a signed smallint where I was using an unsigned int in many places. Then I read about varchars...</p>
  
  <p>"VARCHAR(M) - Length + 1 bytes if column values require 0 – 255 bytes"</p>
  
  <p><em>What?!</em> Now it appears to me as though storing a single varchar would use up so much memory, that I may as well not even get excited with my int vs. smallint because it's vastly overshadowed by the varchar field. So I come here asking if this is true, because it simply can't be? Are varchars really that terrible? Or should I really not be getting excited at all for my smallint discovery?</p>
  
  <p><strong>edit:</strong> Sorry! I should've been more clear. So, let's say I store a varchar with 7 characters, meaning 8 bytes. That means, then, that it uses the same as a number stored in a BIGINT column? That's what I'm concerned about.</p>