Identifying Blocked Queries from ClickHouse PMM Data

Hi Team,

Using the ClickHouse PMM data, we can observe the lock wait time for each query. Is it possible to identify which queries were blocked during this time, either through ClickHouse data or PMM’s default graphs?

Thank you

Hello @Asuwini_P,
When a query is in lock_wait state, that means it is waiting for locks to be released so it can execute. By your question, you have this info already because these are queries being blocked.

Next you will probably ask “how can I see which queries are blocking these?” and unfortunately PMM does not have that data available. You can query SELECT * FROM sys.innodb_lock_waits and observe during your testing which queries are blocking/being blocked.