Database input speed questionby jjhorner (Hermit)
|on Jul 31, 2003 at 15:14 UTC||Need Help??|
jjhorner has asked for the wisdom of the Perl Monks concerning the following question:
I've got large amounts of data that I need to put into a database (a few 10M records).
My question is this:
If I connect to the database, cycle through each line and execute the SQL to add the line to the database, it takes a while to insert into the database across Unix sockets. What ways can I speed up the insertion so that I can batch most of it? It is conceivable that I can do one mass SQL string with multiple inserts at once? Will I gain any speed that way? Example:
Or should I do it normally:
Any advice will be helpful...
J. J. Horner CISSP,CCNA,CHSS,CHP,blah,blah,blah