Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Database input speed question

by Abigail-II (Bishop)
on Jul 31, 2003 at 15:21 UTC ( #279610=note: print w/replies, xml ) Need Help??


in reply to Database input speed question

Many database support some form of bulk insert, like Sybase's bcp utility (and corresponding library). That should be the fastest way of doing multiple inserts. Your database might not support doing a bulk insert into a non-empty table - in that case, insert the stuff into a temporary table, and use a stored procedure to move the stuff from the temporary table into the final table.

Also, if you have indices on the table, drop the indices, do the insert, and create the indices again. Dropping and recreating insert triggers could also be a huge gain, but you have to make sure it's safe to drop the trigger.

Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-08-19 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (186 votes). Check out past polls.

    Notices?