title: MySQL different treatment between VarChar(255) and VarChar(65536)
body: <p>Does anyone know the difference between using VarChar(255) and VarChar(65536) ?</p>
  
  <p>Here's what I know so far : </p>
  
  <ul>
  <li>VarChar(255) will only use one byte for size</li>
  <li>VarChar(65536) will use two bytes for size</li>
  <li>VarChar(65536) exists only since MySQL 5.0.3</li>
  <li>MySQL use a different treatment between 255 and 65536 (don't know the difference though)</li>
  </ul>
  
  <p>What I'm not sure of if is it any performance difference between those varchars.</p>
  
  <p>Let's say I would like to create a table with a multiple type of row.
  Using an enum with 'data_type1' and 'data_type2'</p>
  
  <p>data_type1 will never have more than 255 characters in the varchar
  data_type2 will mostly have more than 255 characters in the varchar</p>
  
  <p>Which solution table would be better ?</p>
  
  <pre><code>id (int) - autoincrement
  type (enum : data_type1, data_type2)
  msg (varchar(255))
  data (TEXT)
  </code></pre>
  
  <p>Using only the 'data' column when type == data_type2 ?</p>
  
  <p>or</p>
  
  <pre><code>id (int) - autoincrement
  type (enum : data_type1, data_type2)
  msg (varchar(65536))
  </code></pre>
  
  <p>Using 'msg' column whatever type is present ?</p>
  
  <p>The type column is actually wanted on both solution for treatment purpose.</p>
  
  <p>EDIT : </p>
  
  <p><strong>When type == data_type2, the data stored will actually never be over 10000 characters</strong></p>
  
  <p>EDIT 2 : </p>
  
  <p><strong>I'm not looking to search in columns msg and data</strong></p>
  
  <p>This is a simple question about storage performance, not indexes or search perf...</p>