Syntax\n------\n\nSHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;\n\nDescription\n-----------\n\nSHOW ANALYZE allows one to retrieve ANALYZE-like output from a currently running statement. The statement\n\n``sql\nSHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;\n`\n\nconnects 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 returns it in a format similar to ANALYZE [FORMAT=JSON] output.\n\nThis is similar to the SHOW EXPLAIN command, the difference being that SHOW ANALYZE also produces runtime statistics information.\n\nUse Case\n\nYou'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.\n\nExamples\n--------\n\nEXPLAIN format=json\nSELECT sum(orders.amount)\nFROM\n  customer JOIN orders ON customer.cust_id=orders.cust_id\nWHERE\n  customer.status='GOLD';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-analyze