From eb5e577f14e204fca1f73af0d83c97727981fa73 Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Tue, 28 Jan 2020 15:31:10 +0300 Subject: [PATCH] Use memory tracker on query level. --- dbms/src/Interpreters/ProcessList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Interpreters/ProcessList.cpp b/dbms/src/Interpreters/ProcessList.cpp index f6dbc8c57d3..75b96f6e855 100644 --- a/dbms/src/Interpreters/ProcessList.cpp +++ b/dbms/src/Interpreters/ProcessList.cpp @@ -187,8 +187,6 @@ ProcessList::EntryPtr ProcessList::insert(const String & query_, const IAST * as /// Track memory usage for all simultaneously running queries from single user. user_process_list.user_memory_tracker.setParent(&total_memory_tracker); user_process_list.user_memory_tracker.setOrRaiseHardLimit(settings.max_memory_usage_for_user); - user_process_list.user_memory_tracker.setOrRaiseProfilerLimit(settings.memory_profiler_step); - user_process_list.user_memory_tracker.setProfilerStep(settings.memory_profiler_step); user_process_list.user_memory_tracker.setDescription("(for user)"); /// Actualize thread group info @@ -201,6 +199,8 @@ ProcessList::EntryPtr ProcessList::insert(const String & query_, const IAST * as /// Set query-level memory trackers thread_group->memory_tracker.setOrRaiseHardLimit(process_it->max_memory_usage); + thread_group->memory_tracker.setOrRaiseProfilerLimit(settings.memory_profiler_step); + thread_group->memory_tracker.setProfilerStep(settings.memory_profiler_step); thread_group->memory_tracker.setDescription("(for query)"); if (process_it->memory_tracker_fault_probability) thread_group->memory_tracker.setFaultProbability(process_it->memory_tracker_fault_probability);