title: MySQL Left join makes query very slow...how can I refactor?
body: <p>I have PHP system that runs a MYSQL query like below</p>
  
  <pre><code>select
  order.id,
  order.name,
  order.date,
  customer.name,
  items.coupon_code,
  from order
  left join customer on order.custid = customer.id
  left join items on items.coupon_code = order.coupon_code
  where items.coupon_new_code is null
  and order.status = 1000
  AND order.promo_code in (1,2)
  </code></pre>
  
  <p>order table has 800K records and items table has 300k records. When I run this the query takes about 9 hours to finish!</p>
  
  <p>If I comment the left join to the items table then the query runs in a few seconds! I am not very efficient with MySQL joins and would really really appreciate if someone can tell me how I can optimise this query to run in an acceptable time frame.</p>