Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a PHP program running right now that is processing database rows of over 6 million. Considering the speed at which number of records have been processed so far, it looks like the whole process might take few days to complete (due to hardware limitations).

I was thinking if I could make changes in the program to remove unnecessary logging and other things that may be consuming time. Can I do this with the current program still running so that further processing would speed up, or will this cause the PHP script to break ?

share|improve this question
 
Just out of curiosity - are you selecting rows and then updating/re-inserting them maybe? –  N.B. Oct 3 at 11:22
 
@N.B. No, I am actually selecting each row and comparing it with every element of an array that has more than 10K elements.. –  Sachyn K Oct 3 at 11:25
2  
@SachynK: In that case consider doing the opposite. Write the array in temporary table (index it as/if needed) and let the database engine do the comparing. It's much better optimized for that. –  Jan Hudec Oct 3 at 11:56
 
thanks @JanHudec, but there are many levels of comparison.. and in the end, i have to export all the results in excel.. –  Sachyn K Oct 3 at 12:05
1  
@SachynK: Even if you fetch all the results, having expressions in the select and only reading their results might still be faster. PHP is rather slow language. –  Jan Hudec Oct 3 at 12:09
show 1 more comment

1 Answer

up vote 6 down vote accepted

You cannot edit your program because it's compiled in memory. Any modification to the source code will be active after you reload the program.
This means that you have to kill the process and reload the script.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.