Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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]
[LanX]: Obelix might offer to find it again ...
[LanX]: not much to translate anyway since Goscinny died
[Eily]: https://en. wiki/List_of_Aster ix_characters some of the names were changed to include a new pun
[LanX]: sure some are even funnier now
[LanX]: some lost because they were not translated like Epidemais
[LanX]: some of the english names are funny too

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2017-05-24 15:05 GMT
Find Nodes?
    Voting Booth?