Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

by pajout (Curate)
on Sep 05, 2008 at 16:07 UTC ( #709327=note: print w/replies, xml ) Need Help??

in reply to When to use forks, when to use threads ...?

I have some experience with mass, remote replication from MySQL, MSSQL and PostgreSQL source databases into one PostgreSQL target database. According to advices above, I would prefer to tune the mass-insertion logic rather than threading or forking. If you can design upserts specifically for every case, following ideas could help you:

- try to recognize what should be inserted and what updated (IDs, columns storing last change time, ...) generally, not row-by-row
- use previously advised ways of insert or update
- use stored procedure upsert_my_table() on the target database
- try to insert more than one row in one dml command
- try to take advantage of existing indexes (on both source and target db) - sometimes upserting from properly sorted source table to (properly sorted) target table makes sense

  • Comment on Re: 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://709327]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-27 16:34 GMT
Find Nodes?
    Voting Booth?