- if you know your data won't violate any indexes during insert, drop the indexes first, insert/update, then reapply your indexes. On small data sets, this is pointless, as the index creation does take time, but on large operations, this is faster.
- if your order of sql operations won't affect each other, break it up and do it in parallel. there is a limit to how well this works. creating 100k processes to do 1 insert will be dog slow. breaking it into 2 processes may gain you something.
- transaction + table lock. you guarantee no one is selecting on your tables, thus, you odn't have to worry about row-level locking.
As I said, don't know what DB you are using, and I only know oracle and postgres really well. But those three (update: was 2) things, especially on bulk operations, will gain you something.
Just don't do the first on a hot database, as you'll slow down all operations due to other processees doing other sql operations. :)
Bart: God, Schmod. I want my monkey-man.
In reply to Re: speedy update routine
by exussum0
in thread speedy update routine
by js1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |