title: SQL Join Big data
body: <p>I have this join:</p>
  
  <pre><code>SELECT a.* 
  FROM `entities_instance` a  
   INNER JOIN `instance_fields_data` artists 
   ON ( a.entity_instance_id = artists.entity_instance_id 
        AND artists.`dynamic_field_name` = 'artists' 
        AND artists.`field_value` like '%8605:%')
   INNER JOIN `instance_fields_data` _enddate 
   ON (a.entity_instance_id = _enddate.entity_instance_id) 
      AND (_enddate.`dynamic_field_name` = 'enddate') 
  WHERE a.`entity_id` = 67 
  GROUP BY a.entity_instance_id
  ORDER BY _enddate.field_value DESC 
  LIMIT 100
  </code></pre>
  
  <p>It needs to return about 5 results but instead I get this error:</p>
  
  <pre><code>The SELECT would examine more than MAX_JOIN_SIZE rows; 
  check your WHERE and use SET SQL_BIG_SELECTS=1 or 
  SET MAX_JOIN_SIZE=# if the SELECT is okay
  </code></pre>
  
  <p>Can someone help me improve this query?
  I don't wan't to user the SQL_BIG_SELECTS command.</p>
  
  <p>Thank you</p>