Bug #34991 Add a way for MySQL to "EXPLAIN" lock usage in a query
Submitted: 3 Mar 2008 7:32
Reporter: Sveta Smirnova Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Locking Severity:S4 (Feature request)
Version:4.1, 5.0, 5.1, 6.0 OS:Any
Assigned to: CPU Architecture:Any

[3 Mar 2008 7:32] Sveta Smirnova
Description:
Currently is not possible to know which locks will be acquired by query before running it. Is possible to guess, of course, but it can be hard for several queries.

How to repeat:
N/A

Suggested fix:
Please add MySQL possiblility to describe locks which would be acquired without running a query. Something like "EXPLAIN LOCKS".
[3 Mar 2008 7:36] Sveta Smirnova
Would be good if this feature would be applicable to UPDATE queries as well as to SELECTs
[3 Mar 2008 16:21] Toby Thain
I'm the original submitter of this issue. I wanted to be able to see an EXPLAIN-like report to help me reason about lock behaviour while designing a query/schema. In particular this should include storage engine specific behaviour.