title: MySQL composite index for OR condition
body: <p>I have a huge table on which I want to run a query with an or condition</p>
  
  <pre><code>SELECT id, upload_key 
  FROM product_data 
  WHERE (status = 0 or updated = 0) and uploaded_on is NULL;
  </code></pre>
  
  <p>The table is more than 50 million records now and takes minutes to execute. I tried creating a composite index on keys <strong>status, updated and uploaded_on</strong> (in the same order as query) but it as turns out, the query doesn't use composite indexes with an OR on two different columns.</p>
  
  <p>Is there a way to create indexes to optimize the query, or should I just move uploaded_on as the first where clause and create an single column index on the same?</p>