I’ve blogged about metadata locks (MDL) in the past (1 2 3) and in particular discussed how best to track them down and troubleshoot threads stuck waiting on metadata locks.
If you’ve had any experience with these, you’ll know finding them isn’t always the most straight-forward task.
So I was glad to see metadata lock instrumentation added to MySQL 5.7.3 as part of performance_schema, which makes tracking these down a breeze! (Note this is only in 5.7.3 currently, and therefore is some time from being GA as of today)!
To use these, performance_schema must be enabled (i.e., performance_schema=1 in your config file).
But, also, the metadata_locks instrument is disabled by default, so even if you enable the …
[Read more]