Nicholas Hart wrote:
I have a php 'cron job' script which is inserting some records. It uses arrays to store 12 field records along with several nested loops in which it tests various currency values from a separate 4 field table and sorts them to get the lowest one for insert into a new 4 field table record. It has about 640,000 Product records per 4 Customers or apporx. 2.4 million records to insert. It takes several hours+ to complete and I am hoping there is a way to speed it up.

If you can get away with it, you might try dumping the data to a csv file and using a "load data infile" within mysql to import the whole batch of data at once. Another thing that might be slowing down your inserts are mysql indexes. If you can disable your indexes, import the data, then re-index afterwards, that should speed up the import.

~Rolan
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to