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

The optimizer used the wrong index in the lookup query #2945

Open
MMyheart opened this issue Sep 27, 2021 · 2 comments
Open

The optimizer used the wrong index in the lookup query #2945

MMyheart opened this issue Sep 27, 2021 · 2 comments
Labels
type/enhancement Type: make the code neat or more efficient

Comments

@MMyheart
Copy link
Contributor

MMyheart commented Sep 27, 2021

Scenario:

1、using schema as follow

ID Index Name By Tag Columns
645917039 "idx_ab" "test" ["a", "b"]
1030578011 "idx_ac" "test" ["a", "c"]

2、execute query lookup on test where test.a == 1 yield test.a, test.b;,
then execute plan as follow
1632731760835-image

3、index idx_ac is used, however, idx_ab is better

Solution:

1、the best index need to contains all of the result columns to avoid additional properties query operations
2、this pr #2958 solutes the problem, and the result is as follow
1632733481259-image

@HarrisChu
Copy link
Contributor

@MMyheart
transfer the issue to current repo.

@HarrisChu HarrisChu transferred this issue from vesoft-inc/nebula-graph Sep 27, 2021
@Sophie-Xie Sophie-Xie added this to the v2.6.0 milestone Sep 27, 2021
@Sophie-Xie Sophie-Xie added the type/bug Type: something is unexpected label Sep 27, 2021
@MMyheart
Copy link
Contributor Author

transfer the pr to current repo, the new pr is #2958

@Sophie-Xie Sophie-Xie modified the milestones: v2.6.0, v2.7.0 Oct 11, 2021
@CPWstatic CPWstatic added type/enhancement Type: make the code neat or more efficient and removed type/bug Type: something is unexpected labels Oct 11, 2021
@Sophie-Xie Sophie-Xie modified the milestones: v2.7.0, v3.0.0 Oct 15, 2021
@Sophie-Xie Sophie-Xie removed this from the v3.0.0 milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

4 participants