Skip to content

Commit

Permalink
MDEV-8192 - THD::set_command() takes 0.05% in OLTP RO
Browse files Browse the repository at this point in the history
Moved THD::set_command() definition to sql_class.h so that it can be inlined.

Overhead change:
THD::set_command        0.05% -> out of radar
  • Loading branch information
Sergey Vojtovich committed Jun 2, 2015
1 parent d298b02 commit adb952f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 0 additions & 8 deletions sql/sql_class.cc
Expand Up @@ -5056,14 +5056,6 @@ void THD::set_status_no_good_index_used()
#endif
}

void THD::set_command(enum enum_server_command command)
{
m_command= command;
#ifdef HAVE_PSI_THREAD_INTERFACE
PSI_STATEMENT_CALL(set_thread_command)(m_command);
#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,
Expand Down
8 changes: 7 additions & 1 deletion sql/sql_class.h
Expand Up @@ -3687,7 +3687,13 @@ class THD :public Statement,
public:
/** Overloaded to guard query/query_length fields */
virtual void set_statement(Statement *stmt);
void set_command(enum enum_server_command command);
void set_command(enum enum_server_command command)
{
m_command= command;
#ifdef HAVE_PSI_THREAD_INTERFACE
PSI_STATEMENT_CALL(set_thread_command)(m_command);
#endif
}
inline enum enum_server_command get_command() const
{ return m_command; }

Expand Down

0 comments on commit adb952f

Please sign in to comment.