in reply to faster with threads?

If you really have such a large amount of data to insert, I would go the easy way and use the LOAD statement of MySQL.

Then all your script has to do is, put together the "load-file" and hand it over to the MySQL server, who will do all the heavy lifting (and faster than you can do with multiple INSERT statements).

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law