mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-30032: EXPLAIN FORMAT=JSON output: print costs
Basic printout for join and table execution costs.
This commit is contained in:
@@ -1033,6 +1033,9 @@ void Explain_select::print_explain_json(Explain_query *query,
|
||||
writer->add_member("select_id").add_ll(select_id);
|
||||
add_linkage(writer);
|
||||
|
||||
if (cost != 0.0)
|
||||
writer->add_member("cost").add_double(cost);
|
||||
|
||||
if (is_analyze && time_tracker.get_loops())
|
||||
{
|
||||
writer->add_member("r_loops").add_ll(time_tracker.get_loops());
|
||||
@@ -1942,7 +1945,13 @@ void Explain_table_access::print_explain_json(Explain_query *query,
|
||||
else
|
||||
writer->add_null();
|
||||
}
|
||||
}
|
||||
|
||||
if (cost != 0.0)
|
||||
writer->add_member("cost").add_double(cost);
|
||||
|
||||
if (is_analyze)
|
||||
{
|
||||
if (op_tracker.get_loops())
|
||||
{
|
||||
double total_time= op_tracker.get_time_ms();
|
||||
|
Reference in New Issue
Block a user