在Apache Ignite中加入查询 [英] Join Query in Apache Ignite

查看:63
本文介绍了在Apache Ignite中加入查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PARTITIONED模式下如何在节点之间执行空间联接查询?当Ignite使用Rendezvous Affinity哈希在节点之间分区数据(默认值为1024)时,如何在分区之间执行联接操作?假设我在缓存中有两个空间数据集(pCache和qCache),每个数据集包含10个分区(1,..,10).ignite如何在这两个数据集上执行联接操作?是pCache的partition1和qCache的partition1吗?

How is spatial join query executed among the nodes in PARTITIONED mode? As Ignite partition the data (default 1024) among the nodes using Rendezvous Affinity hashing, how is join operation executed among the partitions? Suppose I have two spatial datasets in the cache (pCache and qCache), each contains 10 partitions(1, .., 10). How is ignite perform the join operation on this two dataset? Is it partition1 of pCache with partition1 of qCache?

我的第二个问题:在分布式连接的情况下,ignite如何执行相同的操作?

My second question: How is ignite perform the same operation in case of distributed join?

推荐答案

不同缓存的分区之间没有对应关系.如果运行联接操作,则默认情况下将仅执行本地查找.如果未并置数据,则此方法可能会给您部分结果.

There is no correspondence between partitions of different caches. If you run a join operation, then by default only local lookup will be performed.If data is not collocated, then this approach may give you a partial result.

执行全部映射时,每个节点都必须与其他每个节点进行通信,因此消息完全在群集中发送,其中是节点数.这称为分布式联接,它会显着影响性能.如果是JDBC驱动程序,则可以在连接字符串中启用它,或者通过使用 SqlFieldsQuery#setDistributedJoins(...)方法,用于缓存查询API.

When all-to-all mapping is performed, then every node has to communicate with every other node, so messages are totally sent in the cluster, where is the number of nodes. This is called distributed joins, and it affects performance significantly. It may be enabled either in the connection string in case of JDBC driver, or by using SqlFieldsQuery#setDistributedJoins(...) method in case of cache query API.

推荐的进行联接的方法是以不需要分布式联接的方式并置数据.Ignite具有称为亲和力搭配的功能,该功能是专门为此目的而设计的.您可以指定对象的字段,该字段将用于计算亲和力函数.该字段的值不必是唯一的,但它应该是键的一部分.因此,如果要在两个表上执行联接,则可以按亲缘关系对它们进行并置,因此不需要分布式联接.

The recommended way to do joins is to collocate the data in a way, that no distributed joins are needed. Ignite has a feature called affinity collocation, designed specially for this purpose. You can specify a field of an object, that will be used to calculate the affinity function. Value of this field doesn't have to be unique, but it should be a part of a key. So, if you want to perform joins on two tables, you may collocate them by affinity, so no distributed joins will be needed.

这篇关于在Apache Ignite中加入查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆