summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-04-22 13:29:56 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-05-13 15:56:56 +0400
commitb22959903b89e798f8804ec9a815c88f75915cd9 (patch)
tree8b3443332de3bea57ced828a7932ade4add36ce0 /sql/opt_subselect.cc
parent8345bc692192788c25ec004134a3a095437aeb1c (diff)
downloadmariadb-git-b22959903b89e798f8804ec9a815c88f75915cd9.tar.gz
MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Added THD argument to select_result and all derivative classes. This reduces number of pthread_getspecific calls from 796 to 776 per OLTP RO transaction.
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 9804254b35f..167194df785 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -5104,8 +5104,8 @@ TABLE *create_dummy_tmp_table(THD *thd)
class select_value_catcher :public select_subselect
{
public:
- select_value_catcher(Item_subselect *item_arg)
- :select_subselect(item_arg)
+ select_value_catcher(THD *thd_arg, Item_subselect *item_arg):
+ select_subselect(thd_arg, item_arg)
{}
int send_data(List<Item> &items);
int setup(List<Item> *items);
@@ -5216,7 +5216,8 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
subselect_single_select_engine *engine=
(subselect_single_select_engine*)subq_pred->engine;
select_value_catcher *new_sink;
- if (!(new_sink= new select_value_catcher(subq_pred)))
+ if (!(new_sink=
+ new (join->thd->mem_root) select_value_catcher(join->thd, subq_pred)))
DBUG_RETURN(TRUE);
if (new_sink->setup(&engine->select_lex->join->fields_list) ||
engine->select_lex->join->change_result(new_sink, NULL) ||