How do I track down intermittent locks in a MySQL database?
Currently, we have a CRUD plus reporting application that talks to one MySQL database. Intermittently users will report locks when searching, currently, I can only get the approximate time of when that happens (accurate to the minute). The stored procedures on the other hand are logged to the millisecond.
So far I have not been able to trigger the issue, and the notifications by the users of the problem are not close enough to real-time to see what queries are running when the lock is happening.
One idea so far would to be to turn on all query logging the next time it happens since the locks seem to be clustered.
Are there other strategies for finding which queries are causing intermittent locks?