title: Mysql query runs too long on OR condition
body: <p>Here is query what take 12 seconds </p>
  
  <pre><code>SELECT SQL_CALC_FOUND_ROWS DISTINCT `t`.* FROM `wp_pods_bars` AS `t` 
  LEFT JOIN `wp_podsrel` AS `rel_city` ON 
      ( `rel_city`.`field_id` = 13918 AND `rel_city`.`item_id` = `t`.`id` ) OR 
      ( `rel_city`.`related_field_id` = 13918 AND `rel_city`.`related_item_id` = `t`.`id` ) 
  </code></pre>
  
  <p>if I do </p>
  
  <pre><code>SELECT SQL_CALC_FOUND_ROWS DISTINCT `t`.* FROM `wp_pods_bars` AS `t` 
  LEFT JOIN `wp_podsrel` AS `rel_city` ON 
      ( `rel_city`.`field_id` = 13918 AND `rel_city`.`item_id` = `t`.`id` )
  </code></pre>
  
  <p>or</p>
  
  <pre><code>SELECT SQL_CALC_FOUND_ROWS DISTINCT `t`.* FROM `wp_pods_bars` AS `t` 
  LEFT JOIN `wp_podsrel` AS `rel_city` ON 
      ( `rel_city`.`related_field_id` = 13918 AND `rel_city`.`related_item_id` = `t`.`id` ) 
  </code></pre>
  
  <p>each query runs 0,09 seconds. Why so and how to fix this?</p>
  
  <p>EDIT:</p>
  
  <pre><code>EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT `t`.* FROM `wp_pods_bars` AS `t` 
  LEFT JOIN `wp_podsrel` AS `rel_city` ON 
      ( `rel_city`.`related_field_id` = 13918 AND `rel_city`.`related_item_id` = `t`.`id` ) 
  </code></pre>
  
  <p>result</p>
  
  <pre><code>id,select_type,table,type,possible_keys,key,key_len,ref,rows,Extra
  1,SIMPLE,t,ALL,NULL,NULL,NULL,NULL,1340,Using temporary
  1,SIMPLE,rel_city,ref,rel_field_rel_item_idx,rel_field_item_idx,rel_field_rel_item_idx,14,const,barchick.t.id,1,Using index; Distinct
  </code></pre>
  
  <p>second</p>
  
  <pre><code>EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT `t`.* FROM `wp_pods_bars` AS `t` 
  LEFT JOIN `wp_podsrel` AS `rel_city` ON 
  ( `rel_city`.`related_field_id` = 13918 AND `rel_city`.`related_item_id` = `t`.`id` ) 
  </code></pre>
  
  <p>result</p>
  
  <pre><code>id,select_type,table,type,possible_keys,key,key_len,ref,rows,Extra
  1,SIMPLE,t,ALL,NULL,NULL,NULL,NULL,1340,Using temporary
  1,SIMPLE,rel_city,ref,rel_field_rel_item_idx,rel_field_item_idx,rel_field_rel_item_idx,14,const,barchick.t.id,1,Using index; Distinct 
  </code></pre>