-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Shortens blocks' last_key in the SSTable block index. #1361
Conversation
01c0f57
to
69e3e9e
Compare
69e3e9e
to
6262333
Compare
// It is possible to do one character shorter in some case, | ||
// but it is not worth the extra complexity | ||
for pos in (common_len + 1)..left.len() { | ||
if left[pos] != 255u8 { |
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.
what's the meaning of 255 here?
the comment says string, but we operate on bytes, what about utf-8?
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.
255 is the max value for a u8.
It is not especially utf8. All of these are byte strings.
There are already u64 byte representation in there.
We do not expose the last term in block so it should be safe.
2c47e3c
to
937b155
Compare
Codecov Report
@@ Coverage Diff @@
## main #1361 +/- ##
========================================
Coverage 94.28% 94.29%
========================================
Files 234 234
Lines 42528 42634 +106
========================================
+ Hits 40099 40201 +102
- Misses 2429 2433 +4
Continue to review full report at Codecov.
|
Right now we store last key in the blocks of the SSTable index. This PR replaces the last key by a shorter string that is greater or equal and still lesser than the next key. This property is sufficiently to ensure the block index works properly. Related to quickwit#1366
937b155
to
2cb1bd3
Compare
Co-authored-by: PSeitz <PSeitz@users.noreply.github.com>
Co-authored-by: PSeitz <PSeitz@users.noreply.github.com>
Right now we store last key in the blocks of the SSTable index.
This PR replaces the last key by a shorter string that is greater or
equal and still lesser than the next key.
This property is sufficiently to ensure the block index
works properly.