google / google/leveldb

Question about Version::GetOverlappingInputs

Open
#814 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

When GetOverlappingInputs and in level 0, and when check if the newly added file has expanded the range, Why the start and end are not test independently like below? Then we can expand the range as soon as possible.
```diff
diff --git a/db/version_set.cc b/db/version_set.cc
index a459587..26ce691 100644
--- a/db/version_set.cc
+++ b/db/version_set.cc
@@ -526,8 +526,9 @@ void Version::GetOverlappingInputs(int level, const InternalKey* begin,
user_begin = file_start;
inputs->clear();
i = 0;
- } else if (end != nullptr &&
- user_cmp->Compare(file_limit, user_end) > 0) {
+ }
+
+ if (end != nullptr && user_cmp->Compare(file_limit, user_end) > 0) {
user_end = file_limit;
inputs->clear();
i = 0;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.