Commit eaa8c154 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-7004 - Merge scalability fixes from 10.0-power

Preallocate dynamic array on THD mem_root to avoid expensive malloc.
parent 070a6e7a
...@@ -5247,7 +5247,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, ...@@ -5247,7 +5247,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* set a barrier for the array of SARGABLE_PARAM */ /* set a barrier for the array of SARGABLE_PARAM */
(*sargables)[0].field= 0; (*sargables)[0].field= 0;
if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64, if (my_init_dynamic_array2(keyuse, sizeof(KEYUSE),
thd->alloc(sizeof(KEYUSE) * 20), 20, 64,
MYF(MY_THREAD_SPECIFIC))) MYF(MY_THREAD_SPECIFIC)))
return TRUE; return TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment