diff --git a/src/Interpreters/SystemLog.h b/src/Interpreters/SystemLog.h index 9b0c273674c..9b6a23ecff6 100644 --- a/src/Interpreters/SystemLog.h +++ b/src/Interpreters/SystemLog.h @@ -189,7 +189,8 @@ SystemLog::SystemLog(Context & context_, const String & database_name_, const String & table_name_, const String & storage_def_, - size_t flush_interval_milliseconds_) + size_t flush_interval_milliseconds_, + bool lazy_load) : context(context_) , table_id(database_name_, table_name_) , storage_def(storage_def_), @@ -198,6 +199,11 @@ SystemLog::SystemLog(Context & context_, assert(database_name_ == DatabaseCatalog::SYSTEM_DATABASE); log = &Logger::get("SystemLog (" + database_name_ + "." + table_name_ + ")"); + if (!lazy_load) + { + prepareTable(); + } + saving_thread = ThreadFromGlobalPool([this] { savingThreadFunction(); }); }