-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[CLN] Reorganize delta module into seperate module and split out impls and [PERF] Refactor bf get_size to avoid nested loops #2674
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
23b8513
to
0d77acf
Compare
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.
Thank you for cleaning this up!
@@ -52,14 +52,6 @@ impl BlockDelta { | |||
V::delete(prefix, key.into(), self) | |||
} | |||
|
|||
/// Gets the minimum key in the block delta. | |||
pub fn get_min_key(&self) -> Option<CompositeKey> { |
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.
was this not being used anywhere?
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.
nope, but i added a flavor back in stacked pr
@@ -377,11 +377,6 @@ impl SparseIndexManager { | |||
} | |||
} | |||
|
|||
pub fn create(&self, id: &Uuid) -> SparseIndex { |
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.
not being used anywhere?
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.
will clean up separately, as it was not added in this PR and I don't want to retrigger tests
## Description of changes *Summarize the changes made by this PR.* - This PRs main intent is to make get_size() and sizing related operations on delta O(1) instead of O(n). The O(n) behavior was leading to a slow insert time since every call resulted in a get_size(). - Refactored uint32, string, int32 deltas into a single_column_storage delta that is generic over value types and uses a size tracker helper struct. - Refactored DataRecord storage to use a single map instead of one per column, and also one lock - Refactored both deltas to track their sizes, handling overwrites and deletes - Moved the add logic OUT of ArrowWriteableImplementations, and made them dumb proxies for type inversion - Changed several value types to be written with ownership, they are copied under the hood anyways, and our general pattern is to put the onus of cloning on the caller. Int32Arrays are Arc’ed, RoaringBitmap needed to be copied etc. - Handled a stray TODO on DataRecord metadata sizing - Pushed splitting into the delta storage, simplifying the delta layer and getting better use of generics ## Test plan *How are these changes tested?* This change needs more tests, I plan to stack some more tests on this PR. Exisitng tests cover add path but but not post-delete sizing. - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes None
Description of changes
Summarize the changes made by this PR.
stacked with #2684
Test plan
How are these changes tested?
Existing tests cover this change
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
None