1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Sergey Vojtovich
2015-04-28 15:20:48 +04:00
parent 2b253ed41f
commit b85e5efca3
5 changed files with 20 additions and 24 deletions

View File

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