diff options
Diffstat (limited to 'sql/filesort_utils.cc')
-rw-r--r-- | sql/filesort_utils.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc index a3b493b4c7a..d178740d24b 100644 --- a/sql/filesort_utils.cc +++ b/sql/filesort_utils.cc @@ -20,6 +20,8 @@ #include "table.h" +PSI_memory_key key_memory_Filesort_buffer_sort_keys; + namespace { /** A local helper function. See comments for get_merge_buffers_cost(). @@ -128,7 +130,8 @@ uchar *Filesort_buffer::alloc_sort_buffer(uint num_records, the old values */ my_free(m_rawmem); - if (!(m_rawmem= (uchar*) my_malloc(buff_size, MYF(MY_THREAD_SPECIFIC)))) + if (!(m_rawmem= (uchar*) my_malloc(key_memory_Filesort_buffer_sort_keys, + buff_size, MYF(MY_THREAD_SPECIFIC)))) { m_size_in_bytes= 0; DBUG_RETURN(0); @@ -137,7 +140,8 @@ uchar *Filesort_buffer::alloc_sort_buffer(uint num_records, } else { - if (!(m_rawmem= (uchar*) my_malloc(buff_size, MYF(MY_THREAD_SPECIFIC)))) + if (!(m_rawmem= (uchar*) my_malloc(key_memory_Filesort_buffer_sort_keys, + buff_size, MYF(MY_THREAD_SPECIFIC)))) { m_size_in_bytes= 0; DBUG_RETURN(0); @@ -177,7 +181,7 @@ void Filesort_buffer::sort_buffer(const Sort_param *param, uint count) uchar **buffer= NULL; if (!param->using_packed_sortkeys() && radixsort_is_appliccable(count, param->sort_length) && - (buffer= (uchar**) my_malloc(count*sizeof(char*), + (buffer= (uchar**) my_malloc(PSI_INSTRUMENT_ME, count*sizeof(char*), MYF(MY_THREAD_SPECIFIC)))) { radixsort_for_str_ptr(m_sort_keys, count, param->sort_length, buffer); |