-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add Xorfilter #324
add Xorfilter #324
Conversation
LIB_LOG(WARN, "the number of keys is not equal to the size_, ", K_(nbit), K(ret)); | ||
return ret; | ||
} | ||
|
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.
miss else?
uint32_t* counting = (uint32_t*)tmp_allocator.alloc(sizeof(uint32_t) * array_length_); | ||
uint64_t* buckets = (uint64_t*)tmp_allocator.alloc(sizeof(uint64_t) * array_length_); | ||
int* queue = (int*)tmp_allocator.alloc(sizeof(int) * array_length_); | ||
|
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.
alloc once and assign to each pointer?
int max_try = 20; | ||
while (max_try-- > 0) { | ||
seed_++; | ||
memset(stack_hash, 0, sizeof(uint64_t) * size_); |
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.
alloc once and memset once
if (key_pos_ >= size_) { | ||
ret = OB_SIZE_OVERFLOW; | ||
STORAGE_LOG(WARN, "rowkeys is already full", K(ret)); | ||
} else if (OB_FAIL(rowkey.deep_copy(rowkeys_[key_pos_], *allocator))) { |
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.
we can also support insert single rowkey for xor filter builder, then the big space to keep all the rowkeys is no longer needed
What changes were proposed in this pull request?
Add support for xorfilter.
Why are the changes needed?
xorfilter is smaller and faster than bloomfilter, but the build time is slower.
Will break the compatibility? How if so?
No.
Does this PR introduce any user-facing change?
Yes. The user can decide to use bloomfilter or xorfilter by adjusting the parameters
is_xor
using commandALTER SYSTEM SET is_xor = XXX(True or False)
How was this patch tested?
unittest(test_bloom_filter_cache.cpp) and sysbench.
Checklist