title: Slow execution of left join with or condition
body: <p>I have a SQL query which joins another table on a or-condition, like this:</p>
  
  <pre><code>select a.id,b.id from a left join b on (b.prop1=a.id or b.prop2=a.id)
  
  1026 rows in set (12.77 sec)
  </code></pre>
  
  <p>If I split the query into two, without or condition, it is much faster:</p>
  
  <pre><code>select a.id,b.id from a left join b on (b.prop1=a.id)
  1026 rows in set (0.03 sec)
  
  select a.id,b.id from a left join b on (b.prop2=a.id)
  1026 rows in set (0.04 sec)
  </code></pre>
  
  <p>Much faster, but then I manually have to combine the results from the two queries.</p>
  
  <p>How come my initial query is so slow? What can I do to make it faster?</p>
  
  <p>I'm using mysql 5.5.35</p>