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

fix exceeded 80w when query by two indexes with limit #1088

Merged
merged 8 commits into from
Jul 22, 2020

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Jul 9, 2020

fix #1049

Change-Id: I33a8a98b76b735ae8817dcd10da3db1723b459ed

@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

Merging #1088 into master will increase coverage by 2.71%.
The diff coverage is 79.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1088      +/-   ##
============================================
+ Coverage     66.79%   69.51%   +2.71%     
- Complexity     5457     5622     +165     
============================================
  Files           331      331              
  Lines         26966    27082     +116     
  Branches       3859     3893      +34     
============================================
+ Hits          18012    18826     +814     
+ Misses         7186     6409     -777     
- Partials       1768     1847      +79     
Impacted Files Coverage Δ Complexity Δ
...aidu/hugegraph/backend/store/hbase/HbaseTable.java 78.75% <0.00%> (+78.75%) 37.00 <2.00> (+37.00)
.../hugegraph/backend/store/rocksdb/RocksDBTable.java 72.30% <0.00%> (ø) 37.00 <2.00> (ø)
...egraph/backend/store/cassandra/CassandraTable.java 81.20% <50.00%> (ø) 84.00 <5.00> (ø)
...om/baidu/hugegraph/backend/query/QueryResults.java 71.15% <58.33%> (-11.50%) 40.00 <13.00> (-1.00)
...m/baidu/hugegraph/backend/tx/GraphTransaction.java 81.48% <66.66%> (+1.06%) 304.00 <18.00> (+8.00)
...aidu/hugegraph/backend/store/mysql/MysqlTable.java 82.09% <75.00%> (ø) 96.00 <0.00> (ø)
...du/hugegraph/backend/tx/GraphIndexTransaction.java 81.05% <81.03%> (+0.55%) 201.00 <16.00> (+8.00)
.../java/com/baidu/hugegraph/backend/query/Query.java 85.04% <86.11%> (-0.13%) 110.00 <24.00> (+15.00) ⬇️
...va/com/baidu/hugegraph/backend/page/QueryList.java 87.06% <86.36%> (-1.62%) 15.00 <0.00> (ø)
.../baidu/hugegraph/backend/query/ConditionQuery.java 86.40% <90.00%> (+0.19%) 106.00 <7.00> (+5.00)
... and 35 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 3c358f8...bf32823. Read the comment docs.

houzhizhen
houzhizhen previously approved these changes Jul 10, 2020
@@ -210,6 +210,15 @@ public static synchronized CoreOptions instance() {
500
);

public static final ConfigOption<Integer> QUERY_INDEX_INTERSECT_THRESHHOLD =
Copy link
Contributor

Choose a reason for hiding this comment

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

QUERY_INDEX_INTERSECT_THRESHOLD

fix #1049

Change-Id: I33a8a98b76b735ae8817dcd10da3db1723b459ed
Change-Id: I531a7a9ab01095f3d1918a76ad42f8793125eb99
Change-Id: Ia4645ef91c269d5d9cc22f3854ac03014918fa44
Change-Id: If5e26dd7b8f969b03d2883c8423afd265517a336
Change-Id: Ibcb3ed36fbb5909292bc23f6cb8a68e453a8f597
@javeme javeme force-pushed the two-index-query-with-limit branch from 3cd7e69 to 3bf12b4 Compare July 10, 2020 14:33
Change-Id: Idd28bf9523e1ee9c813ad80ef2f4c839794d25a9
@1436516871
Copy link

执行:g.V().hasLabel('person').has('age', between(25,80)).has('sex','男').limit(800001).count()
image

Change-Id: I7195bac43ebb01983f96d6f035b72347f4e7959d
@javeme
Copy link
Contributor Author

javeme commented Jul 18, 2020

cassandra/mysql error:

[ERROR] Tests run: 673, Failures: 1, Errors: 0, Skipped: 21, Time elapsed: 515.208 s <<< FAILURE! - in com.baidu.hugegraph.core.CoreTestSuite
[ERROR] testQueryByRangeIndexWithLimitAndOffset(com.baidu.hugegraph.core.VertexCoreTest)  Time elapsed: 0.425 s  <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<3>
	at com.baidu.hugegraph.core.VertexCoreTest.testQueryByRangeIndexWithLimitAndOffset(VertexCoreTest.java:7075)

note: cassandra IN-ids query won't return results in order.

g.V().has("age", P.between(5, 22)).range(3, 4).toSet();

Transaction query: `Query * from RANGE_INT_INDEX limit 4 where [INDEX_LABEL_ID == 1, FIELD_VALUES >= 5, FIELD_VALUES < 22]`
Transaction query: `Query * from VERTEX where id in [1:James, 1:Lisa, 1:Tom Cat, 1:Hebe]`
will skip offset:
>> v[1:Hebe]
>> v[1:Lisa]
>> v[1:James]

Change-Id: I19482fe851ac8e74b98b0cc6661866bb07ba47a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

通过limit限制返回结果条件下仍报索引数超过80W错误
5 participants