Skip to content
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

Modify index bound value #3285

Merged
merged 10 commits into from
Nov 16, 2021

Conversation

cangfengzhs
Copy link
Contributor

What type of PR is this?

  • bug
  • feature
  • enhancement

What does this PR do?

close issue 2745

Which issue(s)/PR(s) this PR relates to?

Fix the problem of index query interval error

Special notes for your reviewer, ex. impact of this fix, etc:

Additional context:

Checklist:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatible (If it is incompatible, please describe it and add corresponding label.)
  • Need to cherry-pick (If need to cherry-pick to some branches, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to reflect in release notes and how to describe:

                                                            `

@cangfengzhs cangfengzhs added the ready-for-testing PR: ready for the CI test label Nov 8, 2021
@cangfengzhs cangfengzhs linked an issue Nov 8, 2021 that may be closed by this pull request
@cangfengzhs cangfengzhs marked this pull request as ready for review November 9, 2021 02:08
src/graph/optimizer/OptimizerUtils.cpp Show resolved Hide resolved
Comment on lines +261 to +264
} else {
auto tmp = std::make_pair(item.value_, include);
OptimizerUtils::compareAndSwapBound(end, tmp);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this code mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assign min(end,tmp) to end

src/graph/optimizer/rule/IndexScanRule.cpp Show resolved Hide resolved
@cangfengzhs cangfengzhs force-pushed the modify-index-bound-value branch from 1159341 to c6eb158 Compare November 10, 2021 02:08
@codecov-commenter
Copy link

Codecov Report

Merging #3285 (31b3ee7) into master (58f0b44) will increase coverage by 0.06%.
The diff coverage is 91.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3285      +/-   ##
==========================================
+ Coverage   85.24%   85.30%   +0.06%     
==========================================
  Files        1295     1303       +8     
  Lines      118190   119417    +1227     
==========================================
+ Hits       100748   101873    +1125     
- Misses      17442    17544     +102     
Impacted Files Coverage Δ
src/graph/optimizer/rule/IndexScanRule.h 100.00% <ø> (ø)
src/storage/ExprVisitorBase.h 0.00% <0.00%> (ø)
src/storage/exec/StorageIterator.h 94.33% <ø> (+5.45%) ⬆️
src/storage/test/LookupIndexTest.cpp 100.00% <ø> (ø)
src/storage/exec/IndexSelectionNode.h 26.47% <26.47%> (ø)
src/storage/ExprVisitorBase.cpp 29.31% <29.31%> (ø)
src/storage/test/IndexTestUtil.h 66.53% <66.53%> (ø)
src/storage/exec/IndexLimitNode.cpp 66.66% <66.66%> (ø)
src/graph/optimizer/rule/IndexScanRule.cpp 71.98% <80.48%> (-0.20%) ⬇️
src/graph/optimizer/OptimizerUtils.cpp 93.04% <84.09%> (+8.53%) ⬆️
... and 61 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f682359...31b3ee7. Read the comment docs.

src/graph/optimizer/OptimizerUtils.cpp Outdated Show resolved Hide resolved
src/graph/optimizer/OptimizerUtils.cpp Show resolved Hide resolved
h.hint.set_begin_value(std::move(begin));
h.score = IndexScore::kPrefix;
} else if (begin.first == end.first) {
if (begin.second == false && end.second == false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we don't need to return false for case (x, x], [x, x)?

(x, x) has return false in line 244

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good suggestion. I was not sure if (x,x] or [x,x) represented the empty set.

@cangfengzhs cangfengzhs requested review from a team, czpmango and critical27 November 12, 2021 02:13
@critical27 critical27 merged commit e32c06d into vesoft-inc:master Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lookup logic refactor(indexScan bug)
4 participants