Friday, October 8, 2010

MySQL InnoDB deadlock issue - lock mode AUTO-INC

AUTO-INC works as table level lock, which means other threads can't perform an insert in this table.

Hence, it means the insert statement would cause the threads to keep the lock to the end of the current insert SQL statements.

Suggested fix: you would have your own mechanism to generate the unique key to replace the "auto-increment" ID/fields. So that your insert statement may execute concurrently






No comments:

Post a Comment