Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
The stupid question is the question not asked
 
PerlMonks  

Re: DBI Question: bulk insertion with Unique-key constraint

by thezip (Vicar)
on Apr 24, 2008 at 20:06 UTC ( #682708=note: print w/ replies, xml ) Need Help??


in reply to DBI Question: bulk insertion with Unique-key constraint

IMO, the best way to avoid the problem is to not allow it to be a problem in the first place.

You can do this by generating two files, one where all of the rows are guaranteed to unique, and then everything else would be treated as an exception.

Your system will need to intelligently create your bulk insert files to provide the appropriate indices (if it's not able to do that inherently), and to detect for unique key collisions.

I wouldn't think that time would be any consideration for just 200k records.

For the exceptions file, you would then have your preprocessor generate the appropriate SQL script to facilitate the updates.


Your wish is my commandline.


Comment on Re: DBI Question: bulk insertion with Unique-key constraint

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2014-04-23 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (554 votes), past polls