title: MySQL performance - do joining using compsite key increase performance?
body: <p>I have two table with millions of data on it. both table has 2 parameter by which I want to join those tables. query example :</p>
  
  <pre><code>SELECT 
      bills.meter_id,
      records.record_id
  FROM records
  JOIN bills ON (
      bills.mnumber = records.mnumber
      AND bills.end_date = records.enddate
  )
  WHERE records.mnumber IS NOT NULL
  AND records.enddate IS NOT NULL
  </code></pre>
  
  <p>So as you can see I have two tables <strong>records</strong> and <strong>bills</strong> which join using <strong>mnumber</strong> and <strong>endate</strong> fields. currently none of these columns are indexed. What is the best index combination which give best performance for this query. Will <code>GROUP BY records.mnumber,records.enddate</code> help performance?</p>