ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasad Bhalerao <prasadbhalerao1...@gmail.com>
Subject Affinity key in SQL execution
Date Tue, 21 Aug 2018 18:15:57 GMT

I am using key value store and I have configured multiple caches. These
caches have different affinity key. To store the values in cache I am using
following key. Id and affinityId column can be different for different

public class DefaultDataAffinityKey implements DataKey<Long> {

  private static final long serialVersionUID = -6858038049181201872L;
  private long id;

  private long affinityId;

As per this doc
engine automatically optimizes queries that use primary or affinity keys in
the condition section of a SELECT statement.

Now consider this sql: select * from cache_1 where id=? and subscriptionId=?

In this case id is primary key and subscriptionId is a affinitykey for this

But how does the ignite identify that id column is primary key of this
cache and subscriptionId is a affinityKey of this cache?


View raw message