diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-04-28 15:20:48 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-06-19 15:06:34 +0400 |
commit | b85e5efca3032c73b86223ba8799d3be98e5bea9 (patch) | |
tree | 0a2f01c65083ba46c53f0359b6d7626cb977427c /sql/multi_range_read.cc | |
parent | 2b253ed41fb606de3c6d8573f95f69ae2faf18d3 (diff) | |
download | mariadb-git-b85e5efca3032c73b86223ba8799d3be98e5bea9.tar.gz |
MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Pass THD to find_all_keys() and Item_equal::Item_equal().
In MRR use table->in_use instead of current_thd.
This reduces number of pthread_getspecific() calls from 354 to 320.
Diffstat (limited to 'sql/multi_range_read.cc')
-rw-r--r-- | sql/multi_range_read.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 61f344d8689..6e8428f1aad 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -62,7 +62,7 @@ handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, range_seq_t seq_it; ha_rows rows, total_rows= 0; uint n_ranges=0; - THD *thd= current_thd; + THD *thd= table->in_use; /* Default MRR implementation doesn't need buffer */ *bufsz= 0; @@ -814,7 +814,7 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf) { - THD *thd= current_thd; + THD *thd= h_arg->get_table()->in_use; int res; Key_parameters keypar; uint UNINIT_VAR(key_buff_elem_size); /* set/used when do_sort_keys==TRUE */ @@ -1573,7 +1573,7 @@ bool DsMrr_impl::choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, { Cost_estimate dsmrr_cost; bool res; - THD *thd= current_thd; + THD *thd= primary_file->get_table()->in_use; TABLE_SHARE *share= primary_file->get_table_share(); bool doing_cpk_scan= check_cpk_scan(thd, share, keyno, *flags); |