StackOverflow answered a lot of questions before, but i'm looking for a more specific one that I couldn't find an exact answer.
I'm currently using PHP/MySQL with Doctrine 1.2.2 looking forward to improve my script. It actually adds about 300 entries every 5 minutes into the database. Actually this script uses mysql multi-insert, not doctrine.
I was wondering what is better, faster and uses less resources. Thanks in advance.
First Edit and Testing
OK guys, firsts things first :)
I tried first using only MySQL statement. Fabrizio suggested using INSERT DELAYED, but that is not available since I'm using innoDB.
I realized some tests using the MySQL statement running three times each job I have to run. For the first job I received an average of 53 seconds to run, using 6.25 Mb (remember that I load 138 pages here)
For the second job I received an average of 3 minutes and 30 seconds, using 4.25 Mb (remember that I load 510 pages here)
For the third job I received an average of 3 minutes and 9 seconds, using 4.75 Mb (remember that I load 410 pages here)
The first Job I was able to convert do Doctrine, running about the same time (53 seconds), but using 9.75 Mb. On second and third jobs I had a problem, since Doctrine does not support ON DUPLICATE KEY and using replace() makes me lose the data added before, due to Foreign Key and that replace() actually deletes the old value and add a new one.
From this tests, I will still use MySQL query multi-inserting. Any mode ideas to test?
Thanks you all :)