-
Notifications
You must be signed in to change notification settings - Fork 19
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
compaction skip non-overlapping bottom tables #116
Conversation
If all top tables doesn’t contain a bottom table’s range, we can skip the bottom table in the compaction. Reduces write amplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
af9267e
to
5a873e0
Compare
tables = append(tables, newTables...) | ||
tables = append(tables, skippedTbls...) | ||
tables = append(tables, s.tables[right:]...) | ||
sortTables(tables) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you keep assertTablesOrder to make sure assertion is always true?
if iter.Valid() && y.CompareKeysWithVer(iter.Key(), t.Biggest()) <= 0 { | ||
cd.bot = append(cd.bot, t) | ||
added = true | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return here and remove the the added boolean flag check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one bottom table will be added if we return here.
We need to add more bottom tables.
@ngaut PTAL |
If all top tables doesn’t contain a bottom table’s range, we can skip the bottom table in the compaction.
Reduces write amplification.