We have a large query to select some records on a single table. In running the application, it caused deadlock with some other update statement on the same table occasionally. In the deadlock information shown in the mysqld.log, the select statement (pure select statement without for update) causes "Creating sort index", and it causes the "lock mode S locks" in some records. How to avoid the Shared lock in the select statement as I don't expect the SQL statement would cause locking on the table.
↧