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.
This commit is contained in:
Sergey Vojtovich 2015-04-22 13:29:56 +04:00
commit b22959903b
18 changed files with 149 additions and 127 deletions

View file

@ -660,7 +660,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
unit->derived= derived;
if (!(derived->derived_result= new select_union))
if (!(derived->derived_result= new (thd->mem_root) select_union(thd)))
DBUG_RETURN(TRUE); // out of memory
lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED;