本文介绍了以联合方式查询ydn-db的最有效方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置

我有名为' mapNodes01 ',' mapNodes02 ',...,' mapNodes70 '

I got stores called 'mapNodes01', 'mapNodes02', ..., 'mapNodes70'

每个都有许多nodeID(keyPath nodeID )

Each holds a number of nodeIDs (keyPath nodeID)

我得到了另一个名为数据"的商店,其中存储着所有可用的nodeID(keyPath nodeID )的值

I got another store called 'data' that holds values for all available nodeIDs (keyPath nodeID)

之所以这样设置是因为mapNode存储持有不同的NodeID重叠组合.将数据存储的值存储到每个mapNode存储中将是很丑陋的,因为我需要每小时(约7000个节点)下载并刷新数据表.

It is setup like this because the mapNode stores hold different overlapping combinations of nodeIDs. Storing the values of the data store to each mapNode store would be ugly since i need to download and refresh the data table every hour (~7000 nodes).

问题

SELECT * FROM mapNodes01 JOIN data ON data.nodeID=mapNodes01.nodeID

如何有效地对ydn-db进行上述sql查询?

How can i do what the above sql query does with ydn-db effectively?

之后,我需要遍历该集合以调用某些函数(以我的情况为例绘制svg).
最重要的是性能.

I need to iterate through the set afterwards to call some functions (drawing svg in my case).
Most important is performance.

我找到了这个> 如何做我在IndexedDB中执行JOIN类型的查询
但是我更喜欢一个代码示例,因为我通读了所有示例,并且在诸如此类的事情上不是专业人士

i found this > How do I do an JOIN-type query in IndexedDB
but i would prefer a code example since i read through all of it and am not a pro in things like that

推荐答案

当前,您将不得不使用很难使用的 ydn.db.algo.SortedMerge .希望我能完成查询模块,在这种情况下,您只需为任何相等的连接编写多个 where 子句即可.

Currently you will have to use ydn.db.algo.SortedMerge, which is very difficult to use. Hopefully I will finish query module, in that case you just write multiple where clause for any equal join.

这篇关于以联合方式查询ydn-db的最有效方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 02:06