weixin_39606019 2020-11-29 17:11 采纳率: 0%
浏览 0

db: add support for intra-L0 compactions

Intra-L0 compactions are compactions from L0 to L0. They reduce read amplification in scenarios where L0->Lbase compactions cannot keep up. One such scenario is the sysbench/otlp_update_index benchmark which is an update heavy workload.

Intra-L0 compactions are only scheduled when an existing L0->Lbase compaction is already running. We copy the RocksDB heuristics which require the compaction to involve a minimum of 4 L0 files, and to only perform an intra-L0 compaction if the number of L0 files exceeds L0CompationThreshold+2. Additionally, we copy the RocksDB heuristic for determination of which files to include. Specifically, we keep on adding files to the compaction as long as the average file size keeps increasing. There isn't much commentary in RocksDB on what this heuristic is doing, but it seems safer to replicate it rather than come up with a different heuristic.

该提问来源于开源项目:cockroachdb/pebble

  • 写回答

5条回答 默认 最新

  • weixin_39606019 2020-11-29 17:11
    关注

    This change is Reviewable

    评论

报告相同问题?