summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2019-11-09 21:03:23 +0300
committerSergei Petrunia <psergey@askmonty.org>2019-11-12 14:38:31 +0300
commit1ced761e6da4cc61207d7584e25aa18e3505d36e (patch)
tree310bfbc9548799bf0d4a0a5dc06762e0fe349473 /sql/sql_class.h
parentbce71a2909a8add9d0ca848bb387bacfd6e588e9 (diff)
downloadmariadb-git-bb-10.5-mdev20854.tar.gz
MDEV-20854: ANALYZE for statements: not clear where the time is spentbb-10.5-mdev20854
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)
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 2fb5797b325..0618bbdccbf 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2141,6 +2141,22 @@ struct wait_for_commit
extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
+class Gap_time_tracker;
+
+/*
+ Thread context for Gap_time_tracker class.
+*/
+class Gap_time_tracker_data
+{
+public:
+ Gap_time_tracker_data(): bill_to(NULL) {}
+
+ Gap_time_tracker *bill_to;
+ ulonglong start_time;
+
+ void init() { bill_to = NULL; }
+};
+
/**
A wrapper around thread_count.
@@ -3326,6 +3342,7 @@ public:
*/
Apc_target apc_target;
+ Gap_time_tracker_data gap_tracker_data;
#ifndef MYSQL_CLIENT
enum enum_binlog_query_type {
/* The query can be logged in row format or in statement format. */