Hi, 1. Ignite is key-value cache and each cache entry has key and value.
2. Index resides on same node with the data. Actually, Ignite has local indices on nodes and there no distributed index. So, if you run Select query for unique key, you will end up with query being executed on all cache nodes. It should be fixed in future releases [1]. c. Yes. But you can hint Ignite to make it in optimal way. Either disable distributeJoins for query, that makes ignite to run queries locally on every node and then merge the results. Or run local query on affinity node for each key (CustomerID). BTW, transactions are not supported by SQL Grid due to indices are not transactional. [1] https://issues.apache.org/jira/browse/IGNITE-4509 On Thu, Mar 16, 2017 at 11:45 PM, anoorag.saxena <[email protected]> wrote: > Thank you for the quick turnaround, Andrew! > > I have some follow-up questions: > > 1.) //AffinityKey should be a part of entry key and if AffinityKey mapping > is configured then AffinityKey will be used instead of entry key for > entry->partition mapping // > > What is meant by Entry Key in this context? > > > 3.) //Indexes always resides on same node with the data.// > That is my understanding too. Someone explained to me that if I create > an Index on a column in the Cache, the column (Index Key) is also used as > the partition or affinity key. Is that statement true? > > > > > c.) //c.) Lets say I wanted to do a lookup on a key other than Affinity Key > column, can creating an index on the lookup column help? Would I end up > scanning all nodes in that case? > > Staging Cache > CustomerID > CustomerEmail > CustomerPhone > > Target Cache > Seq_Num > CustomerID > CustomerEmail > CustomerPhone > StartDate > EndDate > // > > > In the example above where I am using a Staging Cache with 3 columns and a > Target Cache with 6 columns, lets say CustomerID is my Affinity Key and I > have an Index on CustomerID column in both the caches. > > Now if I process records from Staging Cache one by one > (atomicityMode='TRANSACTIONAL') and compare whether CustomerEmail exists > in > Target Cache or not, will my application scan the Target Cache on all the > nodes? > > > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/Understanding-Cache-Key-Indexes-Partition-and- > Affinity-tp11212p11253.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > -- Best regards, Andrey V. Mashenkov
