title: Meaning of 3 byte numeric in mysql (MEDIUMINT)
body: <p><a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html" rel="nofollow noreferrer">Funny thing</a> I've found abount mysql. MySQL has a 3 byte numeric type - MEDIUMINT. Its range is from -8388608 to 8388607. It seems strange to me. Size of numeric types choosen for better performance, I thought data should be aligned to a machine word or double word. And if we need some restriction rules for numeric ranges, it must be external relative to datatype. For example:</p>
  
  <pre><code>CREATE TABLE ... (
    id INT RANGE(0, 500) PRIMARY KEY
  )
  </code></pre>
  
  <p>So, does anyone know why 3 bytes? Is there any reason?</p>