Most efficient way to query ydn-db in a joining way

孤街浪徒 提交于 2019-12-13 07:46:40

问题


Setup

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

Each holds a number of nodeIDs (keyPath nodeID)

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

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

Question

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

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

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/21515180/most-efficient-way-to-query-ydn-db-in-a-joining-way

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!