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

compaction skip non-overlapping bottom tables #116

Merged
merged 6 commits into from
Sep 2, 2019
Merged

Conversation

coocood
Copy link
Member

@coocood coocood commented Sep 2, 2019

If all top tables doesn’t contain a bottom table’s range, we can skip the bottom table in the compaction.
Reduces write amplification.

If all top tables doesn’t contain a bottom table’s range, we can skip the bottom table in the compaction.
Reduces write amplification.
@coocood
Copy link
Member Author

coocood commented Sep 2, 2019

@ngaut @bobotu PTAL

@coocood coocood changed the title compaction skip non-overlapping bottom tables [WIP]compaction skip non-overlapping bottom tables Sep 2, 2019
@coocood coocood changed the title [WIP]compaction skip non-overlapping bottom tables compaction skip non-overlapping bottom tables Sep 2, 2019
@coocood coocood changed the title compaction skip non-overlapping bottom tables [WIP]compaction skip non-overlapping bottom tables Sep 2, 2019
Copy link

@bobotu bobotu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@bobotu bobotu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tables = append(tables, newTables...)
tables = append(tables, skippedTbls...)
tables = append(tables, s.tables[right:]...)
sortTables(tables)
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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.

@coocood coocood changed the title [WIP]compaction skip non-overlapping bottom tables compaction skip non-overlapping bottom tables Sep 2, 2019
@coocood
Copy link
Member Author

coocood commented Sep 2, 2019

@ngaut PTAL
prepare sysbench now succeed.
ready to merge.

@ngaut ngaut merged commit 2f3d48a into master Sep 2, 2019
@ngaut ngaut deleted the skip-bottom-tables branch September 2, 2019 11:24
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.

3 participants