-
Notifications
You must be signed in to change notification settings - Fork 0
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
Accelerate reference walk when determining relevant obliterates #4
Accelerate reference walk when determining relevant obliterates #4
Conversation
undefined, | ||
false, | ||
); | ||
} | ||
return true; |
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.
can we do anything about this true to end the walk earlier? same thing below
) { | ||
seg.localRefs?.walkReferences((ref) => { | ||
const obliterate = ref.properties?.obliterate as ObliterateInfo | undefined; | ||
if (obliterate?.end === ref && starts.has(obliterate)) { |
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.
i think we can remove the start when we find a match, and when starts are empty, we can stop looking
false, | ||
); | ||
if ( | ||
(seg.movedSeq !== undefined && |
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.
this won't work once we have expansion, as the segment that has the ref won't be moved, so i'm not sure we should add this.
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.
an idea could be to put all the obliterate refs in a stored segment set, and do that scan on that, rather than the tree. something like that should probably be a pr of its own. maybe even two sets, one for starts, and one for ends, so we can quickly find all the starts, then fine corresponding ends.
this.moveSeqs.includes(seg.movedSeq)) || | ||
(seg.localMovedSeq !== undefined && this.localMoveSeqs.has(seg.localMovedSeq)) | ||
) { | ||
seg.localRefs?.walkReferences( |
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.
i think it would be safe to only check the first and last position of the segment, rather than scan the whole thing, as we shouldn't merge segments above the min seq, so the obliterate refs should always stay on the ends of the segments
Closing in favor of #6 |
Make use of the moveSeqs and localMoveSeqs field on mergeTree to avoid walking all of the segments during block insert. Tests are not passing at the moment, I think #3 is needed before they will pass.