Skip to content

Commit

Permalink
MDEV-7004 - Merge scalability fixes from 10.0-power
Browse files Browse the repository at this point in the history
Preallocate dynamic array on THD mem_root to avoid expensive malloc.
  • Loading branch information
Sergey Vojtovich committed Dec 5, 2014
1 parent 070a6e7 commit eaa8c15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5247,8 +5247,9 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* set a barrier for the array of SARGABLE_PARAM */
(*sargables)[0].field= 0;

if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64,
MYF(MY_THREAD_SPECIFIC)))
if (my_init_dynamic_array2(keyuse, sizeof(KEYUSE),
thd->alloc(sizeof(KEYUSE) * 20), 20, 64,
MYF(MY_THREAD_SPECIFIC)))
return TRUE;

if (cond)
Expand Down

0 comments on commit eaa8c15

Please sign in to comment.