title: optimizing large data in php page
body: <p>I'm trying to speed up the time it takes to query 200K rows of data and show it in a web page, it normally takes around 20-30 seconds, but currently I've gotten it down to around 7-10 seconds. I still need it to go around 3-7 seconds at most. </p>
  
  <p>In my query, I'm selecting all the rows in a single table and placing around 5 columns into the PHP script. The query goes like this:</p>
  
  <pre><code>SELECT * FROM table where company = ? and division = ?;
  </code></pre>
  
  <p>I just add the parameters from my session. Then I send the query and the parameters in a <em>.inc</em> file and the <em>inc</em> runs the query. But it also runs a separate query for pagination of data. then it would compare the 2 queries to check for any irregularities between the two. Then it will place the data in a new window. </p>
  
  <p>Are there any known algorithms or techniques I could use to speed up the process? I've already removed any garbage code and sped up some functions but it's still slow.</p>
  
  <p>P.S.: <em>I also just handled the system around 2 days ago so I'm still familiarizing the structure.</em></p>