Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: DBI: speed up insertions in generating database

by hakkr (Chaplain)
on Dec 04, 2004 at 16:45 UTC ( [id://412419]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI: speed up insertions in generating database
in thread DBI: speed up insertions in generating database

Yep defo write out a csv file and then use mysqlimport or a 'Load data infile' statement for each table. If you do stick with DBI Inserts maybe try the inserts with multiple VALUES lists

INSERT INTO $table (field1,field2) VALUES (value1,value2),(values3,val +ues4);
From the mysql docs..

When loading a table from a text file, use LOAD DATA INFILE. This is usually 20 times faster than using a lot of INSERT statements. See section 13.1.5 LOAD DATA INFILE Syntax.

mysqlmonks.org

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://412419]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-18 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found