Hello,
I have a problem in execution speed of one search algorithm. I had benchmark my code and I have found the place where the speed is problem.
I am doing few MySQL queries and I keep founded values in memory (in array) because getting data is complicated (to get all in one query). When I come to place to copy (insert) values from memory to my customly designed MySQL table (I have about 20.000 rows) there is a speed problem of these INSERT statements. It lasts more than10 seconds. I am coping data to MySQL table in one FOR loop with INSERT statements. I created this table to put intermediate search results and then (to get final results) I use JOIN statements with some original tables with this CUSTOM one. All was good until this part when I am coping values from memory to MySQL with INSERT statements...
Should I keep all in memory? If I put all results into session it wasn't also a good solution because I keep session in files and it was also slow - file was about 15MB...
Do you have some guides/hints/link to look about that problem?
Thanks