Skip to content

Commit

Permalink
fix(meta): reduce time complexity of MinOverlappingPicker (#14036) (#…
Browse files Browse the repository at this point in the history
…14043)

Signed-off-by: Little-Wallace <[email protected]>
Co-authored-by: Wallace <[email protected]>
  • Loading branch information
github-actions[bot] and Little-Wallace authored Dec 18, 2023
1 parent 1ce8024 commit c0f3182
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ use risingwave_hummock_sdk::prost_key_range::KeyRangeExt;
use risingwave_pb::hummock::hummock_version::Levels;
use risingwave_pb::hummock::{InputLevel, Level, LevelType, SstableInfo};

use super::{CompactionInput, CompactionPicker, LocalPickerStatistic, MAX_COMPACT_LEVEL_COUNT};
use super::{
CompactionInput, CompactionPicker, LocalPickerStatistic, TrivialMovePicker,
MAX_COMPACT_LEVEL_COUNT,
};
use crate::hummock::compaction::overlap_strategy::OverlapStrategy;
use crate::hummock::level_handler::LevelHandler;

Expand Down Expand Up @@ -118,6 +121,16 @@ impl CompactionPicker for MinOverlappingPicker {
level_handlers: &[LevelHandler],
stats: &mut LocalPickerStatistic,
) -> Option<CompactionInput> {
let picker =
TrivialMovePicker::new(self.level, self.target_level, self.overlap_strategy.clone());
if let Some(input) = picker.pick_trivial_move_task(
&levels.get_level(self.level).table_infos,
&levels.get_level(self.target_level).table_infos,
level_handlers,
stats,
) {
return Some(input);
}
assert!(self.level > 0);
let (select_input_ssts, target_input_ssts) = self.pick_tables(
&levels.get_level(self.level).table_infos,
Expand Down

0 comments on commit c0f3182

Please sign in to comment.