Hello, 2013/5/23 kurt campher <[email protected]>: > So a fundamental design attribute of Riak (and other key/value stores) is > that data retrieval is done by knowing the key. > To pull the first 10 keys is similar to what one would do in a relational DB > like MySQL. > > However with Riak this sort of operation is expensive as a full table scan > is done. The keys are not indexed.
This is the reason I approached the issue using the search features, since indexes anyway exist there. > There some work-arounds/solutions though: > > Use the Riak Secondary index. Documentation is available. In Riak this would require switching the datastore to LevelDB, and in my use case Bitcask is superior. > Set a key which has as a value all the keys in a list format. ['key1', > 'key2', etc...] I will propably make a config file in my app or some temporary variable which will contain 10 keys which I get with a map/reduce than is run daily, and then I'll fetch the predefined set from Riak when I need the "10 first results". Although this will require 10 requests to get 10 results, search would have been ideal since one request can return a big set of results.. It is a pitty the search feature does not support "q=*" as query. _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
