Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
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:
To use shard-index, user should provide: