-
Notifications
You must be signed in to change notification settings - Fork 448
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
Check bloom filter in Get function #2846
Conversation
Construct a 1.8gb size database and perform reading for non-existent entries, this PR is slightly faster than master. |
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.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @rjl493456442)
level_iter.go
line 811 at r1 (raw file):
if l.split != nil { n = l.split(l.iterFile.LargestPointKey.UserKey) }
can you add
// Else l.split == nil, so we use the length of the key. This case can occur when getIter uses SeekPrefixGE.
4eb0200
to
669e425
Compare
I have added the comments, please take another look. |
Looks good! |
This pull request enhances the 'Get' function by incorporating a bloom filter check before loading data. This offers the advantage of minimizing avoidable disk reads, thereby contributing positively to the overall read performance.
The implementation is quite straightforward, as recommended by @jbowens. I use iterator.SeekPrefixGE, a method that internally performs a bloom filter check.
Informs #197