1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-20854: ANALYZE for statements: not clear where the time is spent

Count the "gap" time between table accesses and display it as
r_other_time_ms in the "table" element.

* The advantage of this approach is that it doesn't add any new
  my_timer_cycles() calls.
* The disadvantage is that the definition of what is done during
  "other time" is not that clear: it includes checking the WHERE
  (for this table), constructing index lookup tuple (for the next table)
  writing to GROUP BY temporary table (as we dont account for that time
  separately [yet], etc)
This commit is contained in:
Sergei Petrunia
2019-11-09 21:03:23 +03:00
parent 0117d0e65a
commit 68ed3a81f2
27 changed files with 448 additions and 206 deletions

View File

@ -1811,10 +1811,11 @@ void Explain_table_access::print_explain_json(Explain_query *query,
double total_time= op_tracker.get_time_ms();
if (rowid_filter)
total_time+= rowid_filter->tracker->get_time_fill_container_ms();
writer->add_member("r_total_time_ms").add_double(total_time);
writer->add_member("r_table_time_ms").add_double(total_time);
writer->add_member("r_other_time_ms").add_double(extra_time_tracker.get_time_ms());
}
}
/* `filtered` */
if (filtered_set)
writer->add_member("filtered").add_double(filtered);