Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://682708]
[chora_sid]: hi

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-02-24 14:39 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.