Skip to content

Commit

Permalink
[Enhancement] add config for lazy delta column compaction (StarRocks#…
Browse files Browse the repository at this point in the history
…36654)

Signed-off-by: luohaha <[email protected]>
Signed-off-by: 张敢 <[email protected]>
  • Loading branch information
luohaha authored and Zhangg7723 committed Dec 26, 2023
1 parent 6cbd9bd commit b27596a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ CONF_Int32(cumulative_compaction_num_threads_per_disk, "1");
// when candidate num reach this value, the condidate with lowest score will be dropped.
CONF_mInt64(max_compaction_candidate_num, "40960");

// If true, SR will try no to merge delta column back to main segment
CONF_mBool(enable_lazy_delta_column_compaction, "true");

CONF_mInt32(update_compaction_check_interval_seconds, "10");
CONF_mInt32(update_compaction_num_threads_per_disk, "1");
CONF_mInt32(update_compaction_per_tablet_min_interval_seconds, "120"); // 2min
Expand Down
7 changes: 4 additions & 3 deletions be/src/storage/tablet_updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,9 +2487,10 @@ Status TabletUpdates::compaction(MemTracker* mem_tracker) {
if (info->inputs.size() > 0 && new_bytes > config::update_compaction_result_bytes * 2) {
break;
}
// Partial update generate empty rowset, compact them first.
// Or partial update by column will trigger too many useless compaction cost.
if (info->inputs.size() > 1 && has_partial_update_by_column) {
// When we enable lazy delta column compaction, which means that we don't want to merge
// delta column back to main segment file too soon, for save compaction IO cost.
// Separate delta column won't affect query performance.
if (info->inputs.size() > 1 && has_partial_update_by_column && config::enable_lazy_delta_column_compaction) {
break;
}
info->inputs.push_back(e.rowsetid);
Expand Down

0 comments on commit b27596a

Please sign in to comment.