• Sergei Petrunia's avatar
    MDEV-31577: Make ANALYZE FORMAT=JSON print innodb stats · 6242a9e4
    Sergei Petrunia authored
    ANALYZE FORMAT=JSON output now includes table.r_engine_stats which
    has the engine statistics. Only non-zero members are printed.
    
    Internally: EXPLAIN data structure Explain_table_acccess now has
    handler* handler_for_stats pointer.
    It is used to read statistics from handler_for_stats->handler_stats.
    
    Explain data structures exist after the tables are closed. We avoid
    walking invalid pointers using this:
    - SQL layer calls Explain_query::notify_tables_are_closed() before
      closing tables.
    - After that call, printing of JSON output is disabled. Non-JSON output
      can be printed but we don't access handler_for_stats when doing that.
    6242a9e4
analyze_format_json_timings.result 4.76 KB