cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.73k stars 434 forks source link

sstable: explore index size optimizations #97

Closed petermattis closed 1 hour ago

petermattis commented 5 years ago

RocksDB has added version 3 and version 4 sstable formats:

There is no particular urgency to supporting these formats, but we should investigate whether these format changes move the needle on any benchmarks.

Jira issue: PEBBLE-185

petermattis commented 5 years ago

There is no particular urgency to supporting these formats, but we should investigate whether these format changes move the needle on any benchmarks.

@ajkr do you have an inside knowledge on this?

ajkr commented 5 years ago

I remember format_version=4 saved noticeable space on indexes. But it looks like it depends on setting index_block_restart_interval > 1, which we currently don't do. So it shouldn't be the first thing we try if we ever want to optimize index size.

petermattis commented 5 years ago

So it shouldn't be the first thing we try if we ever want to optimize index size.

Something I've been meaning to ask you about: we saw a situation once where keys larger than a data block were written to a table. The result was that every data block had 1 entry, and the index block was essentially the same size as all of the data blocks combined. I think we could avoid this situation if there was a bit more complexity in the sstable block boundary heuristics. Specifically, we shouldn't allow a block to contain only a single entry if the key for the entry is larger than the target block size.

On the other hand, perhaps it isn't worth futzing with the sstable block boundary heuristics, and instead put effort into blob (wisc-key) storage of large entries.

github-actions[bot] commented 2 years ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to Pebble!

github-actions[bot] commented 12 months ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to Pebble!