summaryrefslogtreecommitdiff
path: root/sql/sql_analyze_stmt.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-06-19 15:04:58 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-06-19 15:06:34 +0400
commit2bc6e29afeea374aa0ef4bc36c7a7b649c20d959 (patch)
tree194e2e20889b64f1a4e9299484d47ee3ed1174c3 /sql/sql_analyze_stmt.cc
parent360176f397c08392589b75da62e91c7e79c7c367 (diff)
downloadmariadb-git-2bc6e29afeea374aa0ef4bc36c7a7b649c20d959.tar.gz
MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Pass THD to Sort_and_group_tracker::report_sorting(). This reduces number of pthread_getspecific() calls from 292 to 290.
Diffstat (limited to 'sql/sql_analyze_stmt.cc')
-rw-r--r--sql/sql_analyze_stmt.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_analyze_stmt.cc b/sql/sql_analyze_stmt.cc
index d2eb46298f1..eae47743b03 100644
--- a/sql/sql_analyze_stmt.cc
+++ b/sql/sql_analyze_stmt.cc
@@ -67,7 +67,7 @@ void Filesort_tracker::print_json_members(Json_writer *writer)
Tracker object to be used with filesort
*/
-Filesort_tracker *Sort_and_group_tracker::report_sorting()
+Filesort_tracker *Sort_and_group_tracker::report_sorting(THD *thd)
{
DBUG_ASSERT(cur_action < MAX_QEP_ACTIONS);
@@ -79,13 +79,13 @@ Filesort_tracker *Sort_and_group_tracker::report_sorting()
varied_executions= true;
cur_action++;
if (!dummy_fsort_tracker)
- dummy_fsort_tracker= new (current_thd->mem_root) Filesort_tracker();
+ dummy_fsort_tracker= new (thd->mem_root) Filesort_tracker();
return dummy_fsort_tracker;
}
return qep_actions_data[cur_action++].filesort_tracker;
}
- Filesort_tracker *fs_tracker= new(current_thd->mem_root)Filesort_tracker();
+ Filesort_tracker *fs_tracker= new(thd->mem_root)Filesort_tracker();
qep_actions_data[cur_action].filesort_tracker= fs_tracker;
qep_actions[cur_action++]= EXPL_ACTION_FILESORT;