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

Avoid full scan of match when there is an Relational In predicate #4748

Merged
merged 3 commits into from
Oct 21, 2022

Conversation

czpmango
Copy link
Contributor

@czpmango czpmango commented Oct 19, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#4708

Description:

How do you solve it?

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

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@czpmango czpmango force-pushed the fix/indexColHint branch 2 times, most recently from 8974b76 to 40fcab6 Compare October 19, 2022 09:05
@czpmango czpmango added ready-for-testing PR: ready for the CI test ready for review labels Oct 19, 2022
@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Oct 20, 2022
@czpmango czpmango requested review from Aiee, jievince and a team October 20, 2022 02:02
@codecov-commenter
Copy link

Codecov Report

Base: 84.67% // Head: 84.70% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (a7922b0) compared to base (74a6577).
Patch coverage: 78.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4748      +/-   ##
==========================================
+ Coverage   84.67%   84.70%   +0.02%     
==========================================
  Files        1358     1358              
  Lines      136094   136200     +106     
==========================================
+ Hits       115238   115363     +125     
+ Misses      20856    20837      -19     
Impacted Files Coverage Δ
src/common/hdfs/HdfsCommandHelper.cpp 0.00% <0.00%> (ø)
src/graph/service/GraphFlags.cpp 100.00% <ø> (ø)
src/graph/util/ExpressionUtils.h 100.00% <ø> (ø)
src/graph/validator/AdminJobValidator.cpp 88.23% <0.00%> (ø)
src/kvstore/raftex/RaftPart.cpp 70.42% <0.00%> (-0.57%) ⬇️
src/storage/admin/RebuildIndexTask.h 100.00% <ø> (ø)
src/clients/meta/MetaClient.cpp 76.60% <33.33%> (+0.13%) ⬆️
src/storage/admin/StatsTask.cpp 77.88% <42.85%> (-2.52%) ⬇️
src/meta/processors/job/StorageJobExecutor.cpp 78.99% <50.00%> (-0.50%) ⬇️
src/common/expression/ContainerExpression.h 91.08% <64.70%> (-4.71%) ⬇️
... and 59 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Aiee
Aiee previously approved these changes Oct 20, 2022
jievince
jievince previously approved these changes Oct 20, 2022
@czpmango czpmango dismissed stale reviews from jievince and Aiee via e5e5b4f October 21, 2022 03:27
@czpmango czpmango force-pushed the fix/indexColHint branch 2 times, most recently from e5e5b4f to 962842b Compare October 21, 2022 03:29
return false;
}
auto rhs = static_cast<const RelationalExpression *>(e)->right();
return rhs->kind() == Expression::Kind::kList || rhs->kind() == Expression::Kind::kSet;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe should limit size of List to avoid stack overflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is the stack overflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Shylock-Hg Construct flatten LogicalExpression instead.

Aiee
Aiee previously approved these changes Oct 21, 2022
jievince
jievince previously approved these changes Oct 21, 2022
fix

small fix

add test case

small change

add test cases

small fix

fmt
@Shinji-IkariG Shinji-IkariG merged commit 01312b1 into vesoft-inc:master Oct 21, 2022
Sophie-Xie added a commit that referenced this pull request Oct 21, 2022
)

* Avoid match full scan when has in predicate

fix

small fix

add test case

small change

add test cases

small fix

fmt

* small delete

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
@Sophie-Xie Sophie-Xie added the cherry-pick-v3.3 PR: need cherry-pick to this version label Oct 21, 2022
Sophie-Xie added a commit that referenced this pull request Oct 21, 2022
* logging error if any error in step (#4759)

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>

* fix storage job (#4762)

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>

* fix issue 4765 (#4768)

* Avoid full scan of match when there is an Relational In predicate (#4748)

* Avoid match full scan when has in predicate

fix

small fix

add test case

small change

add test cases

small fix

fmt

* small delete

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>

Co-authored-by: Harris.Chu <1726587+HarrisChu@users.noreply.github.com>
Co-authored-by: Alex Xing <90179377+SuperYoko@users.noreply.github.com>
Co-authored-by: jie.wang <38901892+jievince@users.noreply.github.com>
Co-authored-by: kyle.cao <kyle.cao@vesoft.com>
@jinyingsunny
Copy link

checked on 3.3-rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-v3.3 PR: need cherry-pick to this version ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants