title: Does mysql LIKE get applied last if there's also an AND against an id field?
body: <p>I have a MySQL query that looks something like this:</p>
  
  <pre><code>select * from cust_comment where note LIKE '%awesome%' and userId=222;
  </code></pre>
  
  <p>Let's assume that the <code>note</code> field is varchar(255) and <code>userId</code> is an int.</p>
  
  <p>The most efficient way to execute this, in my opinion, would be for MySQL to filter on the <code>userId</code> first and then apply the <code>LIKE</code>. Does MySQL do this by default (automatically) or do you have to coerce it to do this or is there another way to make this happen?</p>
  
  <p>Bonus answers: How would the answer to this question differ if <code>userId</code> had an index against it?</p>
  
  <p>More info: I am planning on putting a full-text index against the <code>note</code> field but this may not be possible in the near future so <code>LIKE</code> is being used as a temporary workaround.</p>