title: Pull huge data from MySQL
body: <p>Trying to pull huge data [about 200,000 rows] from MySQL using PHP.
  Getting the error: <i>PHP Fatal error:  Allowed memory size of xxxxx bytes exhausted</i></p>
  
  <p>I have an application which generates almost 80-90 thousand trasnactions every month. This is a growing application, so I can expect the numbers to grow rapidly.
  While generating the monthly or quaterly report, I am getting the memory size error. I tried to increase the allowed memory and it worked.
  But I know allowing more memory is a temprary fix and is not a good practice in long run.</p>
  
  <p>I need some help in scaling this application. </p>
  
  <p>In my opinion, breaking the query result into multiple manageable chunks and join them together should solve the problem.</p>
  
  <p>Is there any alternative/better solution?</p>
  
  <p>Does NoSQL helps here? how?</p>
  
  <p>Edit:</p>
  
  <p>Here is the way data is used:
  The transaction table containes all transaction details along with the references to master data like user-id, place/location id, type of transacation. </p>
  
  <p>The report will:</p>
  
  <ul>
  <li>Pull the records from transaction table</li>
  <li>Replace master references appropriately [replace user-id with name, address, etc]</li>
  <li>Dump the data in csv/xls format</li>
  <li>Store/download the file</li>
  </ul>
  
  <p>Thanks</p>