Skip to content

Commit

Permalink
fix(book): minor nit on tiered compaction
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <iskyzh@gmail.com>
  • Loading branch information
skyzh committed Jan 9, 2025
1 parent cc1b174 commit 0919637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mini-lsm-book/src/week2-03-tiered.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The current trigger only reduces space amplification. We will need to add new tr

### Task 1.2: Triggered by Size Ratio

The next trigger is the size ratio trigger. The trigger maintains the size ratio between the tiers. From the first tier, we compute the size of `this tier / sum of all previous tiers`. For the first encountered tier where this value `> (100 + size_ratio) * 100%`, we will compact all previous tiers and the current tier. We only do this compaction with there are more than `min_merge_width` tiers to be merged.
The next trigger is the size ratio trigger. The trigger maintains the size ratio between the tiers. From the first tier, we compute the size of `this tier / sum of all previous tiers`. For the first encountered tier where this value `> (100 + size_ratio) * 100%`, we will compact all previous tiers excluding the current tier. We only do this compaction with there are more than `min_merge_width` tiers to be merged.

For example, given the following LSM state, and assume size_ratio = 1, we should compact when the ratio value > 101%:

Expand Down

0 comments on commit 0919637

Please sign in to comment.