4 ms·
Secondary Indexing Improvements: Query results are now sorted and paginated, offering developers much richer semantics So the results can be sorted but are not
by bonzoesc 13y ago
Secondary Indexing Improvements: Query results are now sorted and paginated, offering developers much richer semantics
So the results can be sorted but are not stored in sorted order in the secondary indices?
Secondary indexes are stored sorted on disk, but segmented per vnode. Previously, they wouldn't be sorted before being returned to a client.
Suppose you're querying for "Bananas" through "Bavaria"; the node that contains "Bassoon" could return its first result before the node containing "Bananas" and "Barons", which would, in old Riak versions, result in out-of-order results.
Disclosure: I work at Basho, and have been working on riak-ruby-client updates to support the 2i improvements.
- cinbun8 13y agoSorting used to be done through M/R queries. Does Riak perform a M/R sort on the results from each node from this release ? Just wondering how this sort is achieved and what it means for performance, if it is requested.
- bonzoesc 13y agoIt does a merge sort, and I can't see that you can opt out of it: https://github.com/basho/riak_kv/blob/master/src/sms.erl https://github.com/basho/riak_kv/blob/master/src/sms.erl 2i doesn't use mapreduce in normal operation.
- jhancock 13y agoIs there a Lua/openresty client on the horizon?
- ericmoritz 13y agoTurner broadcasting uses Lua/openresty and riak: https://github.com/bakins/lua-resty-riak https://github.com/bakins/lua-resty-riak