1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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.
This commit is contained in:
Sergey Vojtovich
2015-06-19 15:04:58 +04:00
parent 360176f397
commit 2bc6e29afe
3 changed files with 5 additions and 5 deletions

View File

@ -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;