Commit d298b022 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-8191 - THD::set_query() takes 0.07% in OLTP RO

Moved THD::set_query() definition to sql_class.h so that it can be inlined.

Overhead change:
THD::set_query       0.07% -> out of radar
parent 3709c7fc
......@@ -5064,19 +5064,6 @@ void THD::set_command(enum enum_server_command command)
#endif
}
/** Assign a new value to thd->query. */
void THD::set_query(const CSET_STRING &string_arg)
{
mysql_mutex_lock(&LOCK_thd_data);
set_query_inner(string_arg);
mysql_mutex_unlock(&LOCK_thd_data);
#ifdef HAVE_PSI_THREAD_INTERFACE
PSI_THREAD_CALL(set_thread_info)(query(), query_length());
#endif
}
/** Assign a new value to thd->query and thd->query_id. */
void THD::set_query_and_id(char *query_arg, uint32 query_length_arg,
......
......@@ -3704,7 +3704,16 @@ class THD :public Statement,
{
set_query(CSET_STRING(query_arg, query_length_arg, charset()));
}
void set_query(const CSET_STRING &str); /* Mutex protected */
void set_query(const CSET_STRING &string_arg)
{
mysql_mutex_lock(&LOCK_thd_data);
set_query_inner(string_arg);
mysql_mutex_unlock(&LOCK_thd_data);
#ifdef HAVE_PSI_THREAD_INTERFACE
PSI_THREAD_CALL(set_thread_info)(query(), query_length());
#endif
}
void reset_query() /* Mutex protected */
{ set_query(CSET_STRING()); }
void set_query_and_id(char *query_arg, uint32 query_length_arg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment