title: increase speed for MySQL JOIN for two large tables
body: <p>I have to JOIN to large tables in a MySQL query and it takes really long - approximately 180 seconds.  Are there any tips for optimizing a merge?</p>
  
  <p>My table has 10 fields.  I am only using 4 in the query - all strings.  Table has about 600,000 rows and the result should have about 50 rows.</p>
  
  <p>The four used rows are: Title, Variables, Location, Date</p>
  
  <p>Here is my query:</p>
  
  <pre><code>SELECT DISTINCT t1.Title, t1.Variables FROM `MyTABLE` t1 JOIN `MyTABLE` t2  
  USING (Title,  Variables) 
  WHERE (t1.Location, t1.Date) = ('Location1', 'Date1') 
  AND (t2.Location, t2.Date) = ('Location2', 'Date2')
  </code></pre>