Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leveldb: reduce compaction table set of target level #420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qianbin
Copy link
Contributor

@qianbin qianbin commented Aug 8, 2022

During table compaction, tables in source & target level are simply merged together and output to new tables. That's fine for a testing-purpose random dataset. But for a real case, sometimes none of keys in source level falls within some target level tables(L0->L1, especially) . Then these target level tables can be skipped.

This PR implements this feature.

Grepping the db log of my project with 'reducing' shows

16:07:47.800017 table@compaction reducing L0 -> L1 F·-27 S·-86MiB
16:07:57.902166 table@compaction reducing L0 -> L1 F·-7 S·-28MiB
16:08:18.274260 table@compaction reducing L2 -> L3 F·-2 S·-819B
16:08:19.743393 table@compaction reducing L2 -> L3 F·-4 S·-10KiB
16:08:20.480615 table@compaction reducing L2 -> L3 F·-3 S·-1MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant