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
[Enhancement] BitmapValue support copy on write #34047
Conversation
fb1bbf2
to
6b5b28e
Compare
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 65 / 99 (65.66%) file detail
|
|
||
// Use shared_ptr, not unique_ptr, because we want to avoid unnecessary copy | ||
std::shared_ptr<detail::Roaring64Map> _bitmap = nullptr; | ||
std::unique_ptr<phmap::flat_hash_set<uint64_t>> _set; | ||
uint64_t _sv = 0; // store the single value when _type == SINGLE | ||
BitmapDataType _type{EMPTY}; | ||
mutable bool _shared = false; |
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.
why not use shared_counter?
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.
Good idea, let me test it
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
@Mergifyio backport branch-3.0 |
Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit 44ae317) # Conflicts: # be/src/column/nullable_column.cpp # be/src/types/bitmap_value.cpp # be/src/types/bitmap_value.h # be/test/types/bitmap_value_test.cpp
Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit 44ae317) # Conflicts: # be/src/column/nullable_column.cpp # be/src/exprs/bitmap_functions.cpp # be/src/exprs/struct_functions.cpp # be/src/types/bitmap_value.cpp # be/src/types/bitmap_value.h # be/test/types/bitmap_value_test.cpp
Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit 44ae317) # Conflicts: # be/src/column/nullable_column.cpp # be/src/column/object_column.cpp # be/src/exec/pipeline/nljoin/spillable_nljoin_probe_operator.cpp # be/src/exprs/struct_functions.cpp # be/src/exprs/vectorized/bitmap_functions.cpp # be/src/types/bitmap_value.cpp # be/src/types/bitmap_value.h # be/test/types/bitmap_value_test.cpp
Signed-off-by: trueeyu <lxhhust350@qq.com>
https://github.com/Mergifyio backport branch-3.2 |
✅ Backports have been created
|
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
BitmapValue support copy on write.
Time: 5.020s -> 0.043s
Mem: 7.372G -> 0.015G
Time: 10.684s -> 0.048s
Mem: 14.73sG -> 0.014G
Time: 4.251s -> 3.679s
Mem: 29M -> 19M
Time: 7.618s -> 5.045s
Mem: 6.792G -> 3.640G
Time: 2.365s -> 2.316s
Mem: 29.358m -> 17.758m
Time: 4.5s -> 2.1s
Mem: 2.7G -> 2.7G
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: