SHOW ANALYZE
Contents
Syntax
SHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;
Description
SHOW ANALYZE
allows to get ANALYZE output of a currently running statement.
The command
SHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;
connects to the query running in connection connection_id
, gets information about the query plan it is executing, also gets information about the runtime statistics of the execution so far and prints it to the output in a form that ANALYZE
command would produce.
This is similar to SHOW EXPLAIN command, the difference is that SHOW ANALYZE
prints query plan with runtime statistics.
Intended usage
Imagine you're trying to troubleshoot a query that never finishes. Since it doesn't finish, it is not possible to get ANALYZE output for it. With SHOW ANALYZE
, you can get the runtime statistics without waiting for the query to finish.
See also
- SHOW EXPLAIN command
- ANALYZE command
- MDEV-27021: Extend SHOW EXPLAIN to support SHOW ANALYZE [FORMAT=JSON]