File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ impl Interpreter for VacuumDropTablesInterpreter {
187187 let tables_count = tables. len ( ) ;
188188
189189 let handler = get_vacuum_handler ( ) ;
190- let threads_nums = self . ctx . get_settings ( ) . get_max_threads ( ) ? as usize ;
190+ let threads_nums = self . ctx . get_settings ( ) . get_max_vacuum_threads ( ) ? as usize ;
191191 let ( files_opt, failed_tables) = handler
192192 . do_vacuum_drop_tables (
193193 threads_nums,
Original file line number Diff line number Diff line change @@ -178,6 +178,13 @@ impl DefaultSettings {
178178 scope : SettingScope :: Both ,
179179 range : Some ( SettingRange :: Numeric ( 1 ..=1024 ) ) ,
180180 } ) ,
181+ ( "max_vacuum_threads" , DefaultSettingValue {
182+ value : UserSettingValue :: UInt64 ( 1 ) ,
183+ desc : "Sets the maximum number of threads to execute vacuum operation." ,
184+ mode : SettingMode :: Both ,
185+ scope : SettingScope :: Both ,
186+ range : Some ( SettingRange :: Numeric ( 1 ..=3 ) ) ,
187+ } ) ,
181188 ( "max_memory_usage" , DefaultSettingValue {
182189 value : UserSettingValue :: UInt64 ( max_memory_usage) ,
183190 desc : "Sets the maximum memory usage in bytes for processing a single query." ,
Original file line number Diff line number Diff line change @@ -215,6 +215,10 @@ impl Settings {
215215 self . try_set_u64 ( "max_threads" , val)
216216 }
217217
218+ pub fn get_max_vacuum_threads ( & self ) -> Result < u64 > {
219+ self . try_get_u64 ( "max_vacuum_threads" )
220+ }
221+
218222 // Get storage_fetch_part_num.
219223 pub fn get_storage_fetch_part_num ( & self ) -> Result < u64 > {
220224 match self . try_get_u64 ( "storage_fetch_part_num" ) ? {
You can’t perform that action at this time.
0 commit comments