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
Hi,

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
caches.

public class DefaultDataAffinityKey implements DataKey<Long> {

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

  @AffinityKeyMapped
  private long affinityId;



As per this doc
<https://apacheignite-sql.readme.io/docs/performance-and-debugging#section-query-execution-flow-optimizations>
SQL
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
cache_1.

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


Thanks,
Prasad

Mime
View raw message