Hi Boris, My comments are inline.
On Wed, Aug 1, 2012 at 9:01 AM, Ilyushonak Barys <barys_ilyusho...@troika.ru > wrote: > Hi, riak users > > I have object with two different secondary indexes - status and type. For > example, I would like to query all keys with status=new AND type=gloves. > As wiki says "In version 1.0 of Riak, index queries are only supported on > one index field at a time." ( > http://wiki.basho.com/Secondary-Indexes---Configuration-and-Examples.html) > I would like to know: if anything changed in this field since 1.0? Nothing has changed in regards to querying multiple indexes. I.e. only one index can be queried. > > I have found the following solutions for this task: > 1. Create separate index value for specified pair status and type, for > example {<<"index">>, [{<<"status_and_type_bin ">>, term_to_binary({new, > gloves})}]} > Do you really want to use term_to_binary here? Perhaps you could get away with a binary with a known separator like <<"new_gloves">> or <<"new|gloves">> etc. It should save a few bytes per object over external term format. 2. Use the query result by only one index as map-reduce input pipe and > filter values in MR. > If you go this route make sure to query on the more limiting index so MR can process the least amount of objects. Each object needed by MR is random access. > 3. Maybe I think too relational and should use other object structure? Perhaps, that all depends on your problem. The data model, how often data is updated, the types of queries you need to perform, how much data you have, what kind of latency requirements you have, etc. Feel free to elaborate more. -Z
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com