This discussion is archived
6 Replies Latest reply: Jan 5, 2012 10:40 AM by greybird RSS

Oracle NoSQL and indexing

906230 Newbie
Currently Being Moderated
Hi all,

I read that there is an index on key value on each node.
Does that mean that as soon as we have the good key, there is a full scan on all the values for that key on that node?
So to have better performance should we have many keys and fewer values?

Thanks
  • 1. Re: Oracle NoSQL and indexing
    greybird Expert
    Currently Being Moderated
    Each key has exactly one value. By key-value store it is meant that the store is treated like a Map data structure (java.util.Map, for example, if you are a Java programmer).

    --mark                                                                                                                                                                                                                                                                                                                                                                                   
  • 2. Re: Oracle NoSQL and indexing
    906230 Newbie
    Currently Being Moderated
    Hi mark,

    I don't understand why you say each key has exactly one value.
    Suppose we have a key username.
    We can have pairs <username/john> and <username/Jeff>
    So for the same key, we have two values.
    Thanks for you inputs.
  • 3. Re: Oracle NoSQL and indexing
    greybird Expert
    Currently Being Moderated
    I think you mean that you have two keys, /username/john and /username/Jeff. A key may have multiple components -- 'username' and 'john' are the two components of the first key. Each of the two keys also has a value, which is the data stored for that key.

    Are you a programmer, and have you used a Map data structure?

    I suggest that you look in detail at the example program in the examples/schema directory to see how keys and values are used.

    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 4. Re: Oracle NoSQL and indexing
    906230 Newbie
    Currently Being Moderated
    Hi mark,

    For me username was the key and John or Jeff the values.

    When I look for the key username, I expect to have a name as value.
    So, for me it is the key which help me to know what type of value is stored there.
    Am I wrong? I am not used with java for the moment.

    Thanks.
  • 5. Re: Oracle NoSQL and indexing
    greybird Expert
    Currently Being Moderated
    You are using the term "value" incorrectly, and this makes it very difficult to communicate. Please read the NoSQL DB documentation for how this term is used with this product.

    You will need to know Java fairly well before using the NoSQL DB product. You will not be able to understand the API without knowing Java, because the API is currently only available and documented in Java.

    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 6. Re: Oracle NoSQL and indexing
    greybird Expert
    Currently Being Moderated
    When I look for the key username, I expect to have a name as value.
    So, for me it is the key which help me to know what type of value is stored there.
    Am I wrong?>

    I think you are right, but you are using the wrong terminology. Here is the correct terminology: In general a key is a major path and a minor path, where each path is a list of strings. In your case, I believe you're only using the major path. Your major path has two components (two strings). The first component (the constant 'username') tells you what to expect in the second component ('John' or 'Jeff').

    You can think of the second component of your key path as a variable rather than a constant component. But please don't call it a value, since the term value is reserved for something else -- it is the data associated with the key in the key-value pair. After all, this is a key-value store, so key and value are pretty important terms.

    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points