ways to improve the performance of this scenario

前端 未结 6 991
闹比i
闹比i 2021-01-23 05:45

I have a map with huge amount of data being populated (around 300,000 records in approx)

and iterating it as below ,

    for (Map.Entry&         


        
6条回答
  •  伪装坚强ぢ
    2021-01-23 06:10

    Instead of updating the database in each loop.Try to update the database after completing the loop.

    There are different way to optimize the large database update. Best one of that is

    • Insert modified values into a temporary table
    • Update the original table from the temporary table

    Also use a thread based queuing mechanism to send your emails

提交回复
热议问题