title: Database size calculation?
body: <p>What is the most accurate way to estimate how big a database would be with the following characteristics:</p>
  
  <ul>
  <li>MySQL</li>
  <li>1 Table with three columns:
  <ul>
  <li>id --> big int)</li>
  <li>field1 --> varchar 32</li>
  <li>field2 --> char 32</li>
  </ul></li>
  <li>there is an index on field2</li>
  </ul>
  
  <p>You can assume varchar 32 is fully populated (all 32 characters). How big would it be if each field is populated and there are:</p>
  
  <ol>
  <li>1 Million rows</li>
  <li>5 Million rows</li>
  <li>1 Billion rows</li>
  <li>5 Billion rows</li>
  </ol>
  
  <p>My rough estimate works out to: 1 byte for id, 32 bits each for the other two fields. Making it roughly:</p>
  
  <pre><code>  1 + 32 + 32 = 65 * 1 000 000 = 65 million bytes for 1 million rows
  = 62 Megabyte
  </code></pre>
  
  <p>Therefore:</p>
  
  <ol>
  <li>62 Mb</li>
  <li>310 Mb</li>
  <li>310 000 Mb = +- 302Gb</li>
  <li>1 550 000 Mb = 1513 Gb</li>
  </ol>
  
  <p>Is this an accurate estimation?</p>