I've been trying to work around this but haven't found a way besides retrying, which is inefficient for what should be a fairly simple, high-concurrency operation.

I have an InnoDB table on a MySQL 5.6/5.7 DB that has two columns... id + another column (with a unique index). During a transaction, I do a batch SELECT on this table, and then INSERT the missing rows thereafter. However, it's deadlocking due to activity in other simultaneous transactions.

Is there a solution? I've tried setting the transaction mode to READ COMMITTED without seeing any difference.

Your Answer

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

Browse other questions tagged or ask your own question.