Skip to content

Commit

Permalink
vacuum temp files after recluster
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Dec 31, 2024
1 parent 401afdb commit 5b13e45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use databend_common_sql::plans::Recluster;
use log::error;
use log::warn;

use crate::interpreters::hook::vacuum_hook::hook_disk_temp_dir;
use crate::interpreters::hook::vacuum_hook::hook_vacuum_temp_files;
use crate::interpreters::Interpreter;
use crate::interpreters::InterpreterClusteringHistory;
use crate::pipelines::executor::ExecutorSettings;
Expand Down Expand Up @@ -185,6 +187,10 @@ impl ReclusterTableInterpreter {
// make sure the lock guard is dropped before the next loop.
drop(lock_guard);

// vacuum temp files.
hook_vacuum_temp_files(&self.ctx)?;
hook_disk_temp_dir(&self.ctx)?;

InterpreterClusteringHistory::write_log(&self.ctx, start, &plan.database, &plan.table)?;
Ok(false)
}
Expand Down
2 changes: 1 addition & 1 deletion src/query/settings/src/settings_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ impl DefaultSettings {
desc: "Specifies the domain of range IDs in Hilbert clustering. A larger value provides finer granularity, but may incur a performance cost.",
mode: SettingMode::Both,
scope: SettingScope::Both,
range: Some(SettingRange::Numeric(1..=65536)),
range: Some(SettingRange::Numeric(1..=65535)),
}),
("hilbert_sample_size_per_block", DefaultSettingValue {
value: UserSettingValue::UInt64(1000),
Expand Down
2 changes: 1 addition & 1 deletion src/query/sql/src/planner/binder/ddl/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ impl Binder {
.map(|s| {
format!(
"hilbert_key(cast(ifnull(range_partition_id({table}.{s}, _keys_bound.{s}_bound), {}) as uint16))",
partitions - 1
partitions
)
})
.collect::<Vec<_>>()
Expand Down

0 comments on commit 5b13e45

Please sign in to comment.