title: Wordpress Custom Meta Query Search is so slow when in OR relation
body: <p>I made a search which is basically querying custom meta fields and showing the results. For some reason, the search takes endless hours. When I change the relation to "<strong>AND</strong>" it works great but when I change the relation to "<strong>OR</strong>" it's dead.</p>
  
  <p>Currently in the database I have 5 records so it shouldn't take time.</p>
  
  <p><strong>This is the query</strong></p>
  
  <pre><code>$args = array(
    'post_type' =&gt; 'shipping-schedules', 
    'posts_per_page' =&gt; 5,
    'post_status' =&gt; 'publish',
    'paged' =&gt; $paged,
    'meta_query' =&gt; array(
    'relation' =&gt; 'OR',
      array(
        'key' =&gt; 'schedules_port',
        'value' =&gt; $sfrom,
        'compare' =&gt; 'LIKE'
      ),
      array(
        'key' =&gt; 'schedules_port',
        'value' =&gt; $sto,
        'compare' =&gt; 'LIKE'
      ),
      array(
        'key' =&gt; 'schedules_vessel',
        'value' =&gt; $svessel,
        'compare' =&gt; 'LIKE'
      ),
      array(
        'key' =&gt; 'schedules_voyage',
        'value' =&gt; $svoyage,
        'compare' =&gt; 'LIKE'
      ),
      array(
        'key' =&gt; 'schedules_arrival',
        'value' =&gt; $sdate_arrival,
        'compare' =&gt; '&gt;=',
        'type' =&gt; 'NUMERIC'
      ),
      array(
        'key' =&gt; 'schedules_departure',
        'value' =&gt; $sdate_departure,
        'compare' =&gt; '&lt;=',
        'type' =&gt; 'NUMERIC'
      )
    )
  );
  </code></pre>
  
  <p>As you can see in the above query this line <code>'relation' =&gt; 'AND'</code> changing it to <code>'relation' =&gt; 'OR'</code> will result the problem am facing slow querying.</p>