mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +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:
@ -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. */
|
||||
|
Reference in New Issue
Block a user