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.
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:
SELECT * FROM table where company = ? and division = ?;
I just add the parameters from my session. Then I send the query and the parameters in a .inc file and the inc 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.
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.S.: I also just handled the system around 2 days ago so I'm still familiarizing the structure.