问题
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