title: What happend first in mysql: join or where
body: <p>Let's say I have two tables A and B and the following query:</p>
  
  <pre><code>select *
  from A
  inner join B on A.id = B.id
  Where A.id = 5
  </code></pre>
  
  <p>Does mysql first performs the join or the where?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Cause if for example A contains 1000 rows, after the where condition it'll contain only 1 row. 
  Performing join on a 1 row table is much more efficient so it seems like performing the where first and only then the join is more efficient.</p>