title: How to increase the performance of table having 50 millions records and growing
body: <p>We have two tables, table A and table B (contains 50 million records). In table A, we stored a unique value of merchant. From that, we fetched records from table B. How to increase the performance of query and what are the ways to increase performance for it?</p>
  
  <p>Note: The table structure for both tables is simple.<br>
  Table A - storage engine (MyISAM)<br>
  TABLE B - storage engine (MyISAM)<br>
  In table A we have one primary key corresponding to table B's many records.<br>
  Queries Used:<br>
  <strong>Query 1:</strong>   </p>
  
  <pre><code>records = "select field1, field2...  from table A where merchant_id = ''   
  and field_date between '23-06-2012' and '23-06-2015' order by field 1";
  </code></pre>
  
  <p><strong>Query 2: execute in loop</strong> </p>
  
  <pre><code>  foreach (records as records) {
        "select field_b1, field_b2, .. from table B where field_b1 =    
  'records['field1']'"
     }
  </code></pre>