【Tips】多进程执行UPDATE的小技巧

假设有1000万条数据,通过seq命令将其拆为1000份,每份10000条,通过xargs命令并发起5个进程执行。
seq 0 9999 | xargs -I{} -P5 echo 'update xxx set xxx=xxx where id >=1000*{} and id <1000*({}+1)'

猜你喜欢

转载自lc87624.iteye.com/blog/1724511