google / google/leveldb

MaxBytesForLevel considers 1MB for SSTs

Open
#473 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

In leveldb/db/version_set.cc:45:

```
static double MaxBytesForLevel(const Options* options, int level) {
// Note: the result for level zero is not really used since we set
// the level-0 compaction threshold based on number of files.

// Result for both level-0 and level-1
double result = 10. * 1048576.0;
while (level > 1) {
result *= 10;
level--;
}
return result;
}
```
Why is `result` being multiplied by 1048576 (aka 1MB)? Shouldn't it be the specified SST size?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.