how do I disable transaction temporarily if I'm using innodb from java jdbc? I'm doing a mass insert and wonder if it will speed up things. or should I just set autocommit to true?


Actually things will be a bit faster if you perform a mass insert in a single transaction, this is something opposite to setting autocommit to true. Insert will go much faster if you perform it via the "Handler socket" plugin, latest Percona Server already includes it.

  • With large tables that's not true. In my case it takes 5 days to make a INSERT INTO SELECT * FROM. If I instead insert in 10k chunks it takes 2 hours. And the 5 day statement has another problem: If I cancel it there will be a slow rollback takeing weeks to finish. The only way to free that table again is to start mysql in crash recovery mode. – John Jul 24 '18 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.