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

Shard index need to be implemented #270

Closed
zhoney opened this issue Dec 10, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@zhoney
Copy link
Contributor

@zhoney zhoney commented Dec 10, 2018

描述

Shard-index is somehow union range index.

For example person vertex might have city and age properties. If we want to search persons living in Beijing and between 25 and 40 years old, we can create secondary index personByCity and range index personByAge, but querying process is querying persons between 25 and 40 years old by personByAge range index firstly and querying persons lived in Beijing secondly and find out intersections.

Shard-index shards range index keys by adding encoded prefix, which is calculated by shard property. For example, we can create shard index personByAgeShardByCity, which using property city as shard property and age as range index property. With personByAgeShardByCity, persons living in Beijing and between 25 and 40 years old will be queried directly and more effectively.

Usage

To create shard-index, a shard function should be provided, which maps shard property value to an integer value used as encoded prefix of shard index key(e.g. a function map city property to int value).

As discussed above, shard-index should be used:

  • if query by multi-properties conditions and one of those properties is range condition.
  • if want to avoid range query with too many records by splitting range index using shard-index.

To use shard-index, user should provide:

  • shard property value condition
  • range property value range condition
@zhoney zhoney added the feature label Dec 10, 2018
@javeme javeme added the 0.10 label Apr 13, 2019
@javeme javeme added this to the 0.10 milestone Apr 13, 2019
@javeme javeme removed the 0.10 label Apr 13, 2019
zhoney added a commit that referenced this issue Jun 18, 2019
implemented: #270 and #398

Change-Id: I444b67b7f57a18fd32c29d54d776cf411ccd847a
zhoney added a commit that referenced this issue Jun 26, 2019
implemented: #270 and #398

Change-Id: I444b67b7f57a18fd32c29d54d776cf411ccd847a
zhoney added a commit that referenced this issue Jul 22, 2019
implemented: #270 and #398

Change-Id: I444b67b7f57a18fd32c29d54d776cf411ccd847a
zhoney added a commit that referenced this issue Jul 31, 2019
implemented: #270 and #398

Change-Id: I444b67b7f57a18fd32c29d54d776cf411ccd847a
Linary added a commit that referenced this issue Aug 6, 2019
implemented: #270 and #398

Change-Id: I444b67b7f57a18fd32c29d54d776cf411ccd847a
@javeme javeme closed this Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.