summaryrefslogtreecommitdiff
path: root/sql/uniques.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-01-29 13:50:26 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:22 +0100
commit7c58e97bf6f80a251046c5b3e7bce826fe058bd6 (patch)
tree7d32d26b320cf83296ee0ede2ea164ad116c4de8 /sql/uniques.cc
parent2ac3121af2767186c489054db5d4871d04b8eef4 (diff)
downloadmariadb-git-7c58e97bf6f80a251046c5b3e7bce826fe058bd6.tar.gz
perfschema memory related instrumentation changes
Diffstat (limited to 'sql/uniques.cc')
-rw-r--r--sql/uniques.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/uniques.cc b/sql/uniques.cc
index db9891158b0..6b486e48444 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -93,8 +93,8 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
init_tree(&tree, (max_in_memory_size / 16), 0, size, comp_func,
NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC));
/* If the following fail's the next add will also fail */
- my_init_dynamic_array(&file_ptrs, sizeof(Merge_chunk), 16, 16,
- MYF(MY_THREAD_SPECIFIC));
+ my_init_dynamic_array(&file_ptrs, PSI_INSTRUMENT_ME, sizeof(Merge_chunk), 16,
+ 16, MYF(MY_THREAD_SPECIFIC));
/*
If you change the following, change it in get_max_elements function, too.
*/
@@ -662,7 +662,8 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
is needed when a piece of merge buffer is re-read, see merge_walk()
*/
size_t buff_sz= MY_MAX(MERGEBUFF2+1, max_in_memory_size/full_size+1) * full_size;
- if (!(merge_buffer = (uchar *)my_malloc(buff_sz, MYF(MY_WME))))
+ if (!(merge_buffer = (uchar *)my_malloc(key_memory_Unique_merge_buffer,
+ buff_sz, MYF(MY_THREAD_SPECIFIC|MY_WME))))
return 1;
if (buff_sz < full_size * (file_ptrs.elements + 1UL))
res= merge(table, merge_buffer, buff_sz,
@@ -782,7 +783,8 @@ bool Unique::get(TABLE *table)
{
/* Whole tree is in memory; Don't use disk if you don't need to */
if ((sort.record_pointers= (uchar*)
- my_malloc(size * tree.elements_in_tree, MYF(MY_THREAD_SPECIFIC))))
+ my_malloc(key_memory_Filesort_info_record_pointers,
+ size * tree.elements_in_tree, MYF(MY_THREAD_SPECIFIC))))
{
uchar *save_record_pointers= sort.record_pointers;
tree_walk_action action= min_dupl_count ?
@@ -801,7 +803,7 @@ bool Unique::get(TABLE *table)
if (flush())
DBUG_RETURN(1);
size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size;
- if (!(sort_buffer= (uchar*) my_malloc(buff_sz,
+ if (!(sort_buffer= (uchar*) my_malloc(key_memory_Unique_sort_buffer, buff_sz,
MYF(MY_THREAD_SPECIFIC|MY_WME))))
DBUG_RETURN(1);