Question

For GWan's key value store can I create more than one index for a given single type of entity? Also can I query more than one index at once such as find a item with age > 5 and height > 100 if I indexed age and height.

Was it helpful?

Solution

can I create more than one index for a given single type of entity?

If you mean, having several indexes for multiple fields in a record (more than one value for a key) then yes, you can. Just look at the kv.c example: http://gwan.ch/source/kv.c (for any reason, the Stackoverflow text formatting menu is not displayed, so I wrote the link in the text rather than embedded - also, if someone could PLEASE stop the captcha that I must enter to reply to each question, that would be nice).

can I query more than one index at once such as find a item with age > 5 and height > 100 if I indexed age and height?

You can easily write a function to do that and find the records that appear in the first search on the first index AND in the second search for the second index.

This is very fast as the results are returned sorted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top