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

composite index with != and == #2849

Closed
HarrisChu opened this issue Sep 13, 2021 · 3 comments
Closed

composite index with != and == #2849

HarrisChu opened this issue Sep 13, 2021 · 3 comments
Assignees
Labels
priority/med-pri Priority: medium type/enhancement Type: make the code neat or more efficient
Milestone

Comments

@HarrisChu
Copy link
Contributor

https://discuss.nebula-graph.com.cn/t/topic/5749

(root@nebula) [sf01]> show create tag Person
+----------+-----------------------------------+
| Tag      | Create Tag                        |
+----------+-----------------------------------+
| "Person" | "CREATE TAG `Person` (            |
|          |  `firstName` string NULL,         |
|          |  `lastName` string NULL,          |
|          |  `gender` string NULL,            |
|          |  `birthday` string NULL,          |
|          |  `creationDate` string NULL,      |
|          |  `locationIP` string NULL,        |
|          |  `browserUsed` string NULL        |
|          | ) ttl_duration = 0, ttl_col = """ |
+----------+-----------------------------------+
Got 1 rows (time spent 1441/5617 us)

Mon, 13 Sep 2021 14:44:22 CST

(root@nebula) [sf01]> show tag indexes
+----------------+----------+-------------------------------------+
| Index Name     | By Tag   | Columns                             |
+----------------+----------+-------------------------------------+
| "idx_person"   | "Person" | ["firstName", "lastName", "gender"] |
+----------------+----------+-------------------------------------+
| "idx_person_1" | "Person" | ["firstName", "gender"]             |
+----------------+----------+-------------------------------------+
Got 2 rows (time spent 1251/8167 us)

Mon, 13 Sep 2021 14:44:50 CST

(root@nebula) [sf01]> match (v:Person) where v.firstName=='Ousmane' and v.gender=='male' return count(v)
+----------+
| count(v) |
+----------+
| 1        |
+----------+
Got 1 rows (time spent 2241/78536 us)

Mon, 13 Sep 2021 14:45:47 CST

(root@nebula) [sf01]> match (v:Person) where v.firstName=='Ousmane' and v.gender!='male' return count(v)
+----------+
| count(v) |
+----------+
| 0        |
+----------+
Got 1 rows (time spent 2197/6042 us)

Mon, 13 Sep 2021 14:45:58 CST

(root@nebula) [sf01]> match (v:Person) where v.firstName!='Ousmane' and v.gender!='male' return count(v)
+----------+
| count(v) |
+----------+
| 778      |
+----------+
Got 1 rows (time spent 35294/39697 us)

Mon, 13 Sep 2021 14:46:09 CST

but

(root@nebula) [sf01]> match (v:Person) where v.firstName!='Ousmane' and v.gender=='male' return count(v)
[ERROR (-1005)]: IndexNotFound: No valid index found

Mon, 13 Sep 2021 14:46:20 CST


@HarrisChu HarrisChu added the type/bug Type: something is unexpected label Sep 13, 2021
@HarrisChu HarrisChu added this to the v2.6.0 milestone Sep 13, 2021
@Sophie-Xie Sophie-Xie modified the milestones: v2.6.0, v2.7.0 Sep 15, 2021
@Sophie-Xie Sophie-Xie added type/enhancement Type: make the code neat or more efficient priority/med-pri Priority: medium and removed type/bug Type: something is unexpected labels Sep 15, 2021
@Sophie-Xie
Copy link
Contributor

Technical Committee discuss it which will be fixed in MATCH rearchitecting.

@HarrisChu
Copy link
Contributor Author

fixed in the master branch.

@czpmango
Copy link
Contributor

czpmango commented Dec 8, 2021

Duplicated issue, fixed in #3311

@czpmango czpmango closed this as completed Dec 8, 2021
Repository owner moved this from Backlog to Done in Nebula Graph v3.0.0 Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/med-pri Priority: medium type/enhancement Type: make the code neat or more efficient
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants