LeeLee
LeeLee

Reputation: 178

Why does LevelDB make its lower level 10 times bigger than upper one?

According to the official document, there is no doubt that lower level is 10 times bigger than upper one in LevelDB.

The question is why 10? not 2? not 20? It is due to some rigorous math calculations or it just works?

I have read the original LSMT paper. I can understand the multi-components part, because it will be too hard to merge c0 tree with a super large c1 tree. But the paper shows nothing about what the best parameter is.

Am I right? It is actually an interview question. How can I answer it properly if there is no best parameter?

Upvotes: 1

Views: 211

Answers (1)

sel-fish
sel-fish

Reputation: 4476

10x is a reasonable value, may not be rigorous.

The value of this coefficient can't be too small, because will make too many level, which is not friend to read, and will result in more space amplification.

It can't be too large as you mentioned, the cost of compact will increase, with higher average number of participant ssts.

Upvotes: 2

Related Questions