I'm updating huge amount of data by passing a variable List in MyBatis to Oracle DB.
Methods from this link are not efficient enough for me, the ways to commit update sql query line by line, for loop in sql query or Executor.batch service are way too slow from what I expect.
//one of the method i use
<update id="updateAll">
BEGIN
<foreach collection="list" item="item" index="index" separator=";">
UPDATE <include refid="tableName"/>
<set>
item_price = ${item.price}, update_time = ${item.updateTime}
</set>
WHERE id = ${item.id}
</foreach>
;END;
</update>
With the ways I tried, my system spend 10 - 30 seconds or maybe longer to complete the update. There will be around 10,000 rows of data per sec from server. Is there is any way to update at least 1-2k rows of data within 1 or 2 second in Oracle db?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…