Home > Back-end >  Springboot mybatis under batch updates, involving many table update efficiency is slow
Springboot mybatis under batch updates, involving many table update efficiency is slow

Time:09-16

Now project involves three tables, user, App, pro, these three table represent the users table, application, and issue list, scene when users click through the inside of the need to update the App pass fields, also need to update the user an end inside field is 1, then the corresponding user pro field inside pass is set to 1, said through the authentication, but efficiency thief slowly, now is to click on the [batch through] after such a long time to show the update is successful, it has just started to think what you're using the @ Transaction Exception this annotation the cause of slow, later removed after is slow, have any Suggestions

CodePudding user response:

According to this description, you three SQL line ah, you won't be a quick update?

CodePudding user response:

The table data, if no index update condition will slowly, reasonable use of index, the use of SQL execution plan view index usage

CodePudding user response:

Your batch through the corresponding code, according to the article submission?
Background to enable things management, batch submission, don't submitted according to the article,

CodePudding user response:

Efficiency problems have gradually, see which block slowly, slowly adjust the database SQL, lock what of,,

CodePudding user response:

Thanks for your reply, the foreground is a form, send it to the background of id is one by one, and then use the enhanced for loop according to the id to complete the above updates, 3/f may said makes sense, but the background how to enable the transaction management

CodePudding user response:

If it's too big, temporary building a table, update the ok to delete the original table, to change the name of the table,
  • Related