Description\n-----------\n\nANALYZE FORMAT=JSON is a mix of the EXPLAIN FORMAT=JSON and ANALYZE statement features. The ANALYZE FORMAT=JSON $statement will execute $statement, and then print the output of EXPLAIN FORMAT=JSON, amended with data from the query execution.\n\nBasic Execution Data\n\nYou can get the following also from tabular ANALYZE statement form:\n\n r_rows is provided for any node that reads rows. It shows how many rows were read, on average.\n r_filtered is provided whenever there is a condition that is checked. It shows the percentage of rows left after checking the condition.\n\nAdvanced Execution Data\n\nThe most important data not available in the regular tabular ANALYZE statement are:\n\n r_loops field. This shows how many times the node was executed. Most query plan elements have this field.\n r_total_time_ms field. It shows how much time in total, in milliseconds, was spent executing this node. If the node has subnodes, their execution time is included.\n   For UPDATE and DELETE statements, top-level query_block.r_total_time_ms does include the time to make row deletions/updates but does NOT include the time to commit the changes.\n r_buffer_size field. Query plan nodes that make use of buffers report the size of buffer that was used.\n\nInnoDB engine statistics\n\nStarting from MariaDB 10.6.15, MariaDB 10.8.8, MariaDB 10.9.8, MariaDB 10.10.6, MariaDB 10.11.5, MariaDB 11.0.3, MariaDB 11.1.2 and MariaDB 11.2.1 (MDEV-31577), the following statistics are reported for InnoDB tables:\n\n``json\n"r_engine_stats": {\n        "pages_accessed":  integer,\n        "pages_updated": integer,\n        "pages_read_count": integer,\n        "pages_prefetch_read_count": integer,\n        "pages_read_time_ms": double,\n        "old_rows_read": integer\n      }\n`\n\nOnly non-zero members are printed.\n\n pages_accessed is the total number of buffer pool pages accessed when reading this table.\n pages_updated is the total number of buffer pool pages that were modified during the execution of the statement.\n pages_read_count is the number of pages that InnoDB had to read from disk for this table. If the query touches "hot" data in the InnoDB buffer pool, this value will be 0 and not present.\n pages_prefetch_read_count Number of pages for which read-ahead was initiated. Not all such pages will necessarily be accessed.\n pages_read_time_ms is the total time spent reading the table.\n old_rows_read is the number of old row versions that InnoDB had to read. Old row version is the version of the row that is not visible to this transaction.\n\nSHOW ANALYZE FORMAT=JSON\n\nMariaDB starting with 10.9\n\nSHOW ANALYZE FORMAT=JSON for <connection_id>\\\nextends ANALYZE [FORMAT=JSON] <select> to allow one to analyze a query currently running in another connection.\n\nData About Individual Query Plan Nodes\n\n filesort node reports whether sorting was done with LIMIT n parameter, and how many rows were in the sort result.\n block-nl-join node has r_loops field, which allows to tell whether Using join buffer was efficient.\n range-checked-for-each-record reports counters that show the result of the check.\n expression-cache is used for subqueries, and it reports how many times the cache was used, and what cache hit ratio was.\n* union_result node has r_rows` so one can see how many rows were produced after UNION operation and so forth.\n\nUse Cases\n\nSee Examples of ANALYZE FORMAT=JSON.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/analyze-format-json