https://slatedb.io logo
I was thinking about something theorical
# general
p
I was thinking about something theorical, traditionally lsm trees have l0 and l1 l1 has no overlapping keys, would it make sense to have a l0.5 that allows some amount of overlapping keys to reduce compaction amplification?
c
That's an interesting idea... I need to think about how exactly it would work. 🤔
kinda wonder if that's roughly equivalent to just compacting some of the L0s into an SR and leaving the others
p
You still force l1 compaction that way
My thinking is that perhaps, it's better to have some amount of overlap because querying multiple ssts is cheap
While compacting is expensive
Especially in write-heavy workloads
c
Gotcha.. hmm
p
I think it probably doesn't make much sense in scenarios where random ios are very expensive system-wide (say hdds), but slatedb isn't bound by that
r
Trying to understand the idea. Would this be equivalent to having a lower bound on the number of similarly sized runs before compacting them? So you compact L0 when there's 4 SSTs vs 8?
p
I think it doesn’t change that logic
It would be more of a additional level in the end
Perhaps that then the l0 max ssts limit can be more of a “max overlapping ssts” that is shared between the two levels
r
I'm having a hard time imagining what you're describing. An example of the SSTs and their key ranges would probably help
p
@Rohan Instead of having completely non-overlapping keys, you could have a "factor" that allows some overlapping when new ssts comes to this level