title: MySQL ENUM VS INT
body: <p>I have few tables that have columns that can either be <code>ENUM</code> type or <code>INT</code> type. I tend to always use integer type assuming that it will be faster to perform search based on it.</p>
  
  <p>For example one of my table has a column: <code>StatusType</code> which can have only 4 possible values: <code>Completed</code>, <code>In Progress</code>, <code>Failed</code>, <code>Todo</code>.</p>
  
  <p>Instead of storing above as <code>ENUM</code> strings I store them as:</p>
  
  <p><code>1</code>, <code>2</code>, <code>3</code>, <code>4</code> respectively. And then in my PHP code I have constant variables that define these values like this:</p>
  
  <pre><code>define('COMPLETED', 1);
  define('IN_PROGRESS', 2);
  define('FAILED', 3);
  define('TODO', 4);
  </code></pre>
  
  <p>Now my question is, am I doing it right way or I should just change it to be <code>ENUM</code> type and use strings to compare in queries? I have many other columns that can only have set of max <code>4-5</code> possible values.</p>