-
Notifications
You must be signed in to change notification settings - Fork 2
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
Btree random insertion test #364
Conversation
// this should be the leaf node | ||
if int(parent.Size()) > t.PageFile.PageSize() { | ||
panic("too fat!") | ||
} |
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.
When we reach the point where we finally serialize the leaf
node post top-down traversal, that leaf
size can exceed a page. I was going to split, but is creating an intermediate node with only one element (the mid key) be sufficient?
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.
Hmm I think splitting while traversing downwards won't work because of this problem. Adding an intermediate node isn't great because there is a degenerate sequence of inserts that will always trigger an intermediate node insertion leading to bad asymptotic performance.
Specifically, right now you're splitting the tree as you're traversing down to the leaf node but instead it might be easier to insert it first and then propagate the split back up the tree. This would fix the issue as you wouldn't need to create an intermediate node.
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.
Sounds good
No description provided.