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

Re^3: When to use forks, when to use threads ...?

by tilly (Archbishop)
on Sep 05, 2008 at 11:40 UTC ( #709251=note: print w/ replies, xml ) Need Help??

in reply to Re^2: When to use forks, when to use threads ...?
in thread When to use forks, when to use threads ...?

Those are called upserts and the SQL 03 standard for that (may not be implemented in your database) is called merge. If that is not implemented and no other variants exist you can do an update followed by an insert of everything that is not found.

In any case variants of Perrin's solution is the standard way to do it. Load a temporary table, then do the update within the database. If there is The primary key index should not be dropped, but all other indexes can be, and then can be re-created. With a good database that should be the most efficient way to go.

Comment on Re^3: When to use forks, when to use threads ...?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-11-26 00:20 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (693 votes), past polls