Home > Enterprise >  How to improve spring boot and mysql single insert statement performance which is called many times
How to improve spring boot and mysql single insert statement performance which is called many times

Time:06-25

I have single insert statement

insert into mq_message (id, message, type, ..) values (...)

This statement is called in spring boot chat application each time message sent to chat channel. We already have many many chat channels and huge number of users.

How to improve its performance or is there any method so that spring data can batch these insert queries ??

Appreciate your help.

CodePudding user response:

Try to use the transaction (begin insert query and commit) Refer the scenario 3 of the given link

Insert Query Optimization

CodePudding user response:

Let's see SHOW CREATE TABLE mq_message -- Getting rid of some redundant indexes will help a little.

  • Related