sql - orientDB - graph - updated nodes based on index lookup -
i have graph structure root node, several container nodes (i'll call them lvl1) each containing hundreds of thousands of content nodes (lvl2). content nodes may linked arbitrary numbers of other content nodes. lvl1 nodes never link each other , link lvl2 nodes once. when graph gets constructed, links between lvl2 nodes may appear multiple times, in case need keep count of links (increment depth
property on appropriate edge). order of construction quite random.
i'm looking efficient way manage graph structure orientdb. building eays, problem updating lvl2 nodes (adding more links) , links between them.
one way select standard sql-query, select lvl2nodes id = 114
- query whole dataset , slow, far can see (i didn't test yet).
so idea use index lookups. created automatic indexing create index lvl2node.id unique
, tried query that: select index:lvl2node.id key = 114
, gives me tuple ({:key 114, :rid #<odocument lvl2node#8:1{id:114,in:[2],out:[1]} v1>})
.
now, how can
a) use information select node , update properties ,
b) find edge between 2 such vertices perform update similarly
or there better method update graphs' vertices, exploiting graph structure? lvl1 node's still contain many links need traversed without hash-map's approach.
i'm using clojure's clj-orient api access orientdb.
like stated in orientdb wiki :
[...] "when you've millions of records indexes show limitation because cost find records o(logn). main reason why relational dbms slow huge database. when you've millions of record best way scale linearly avoid using indexes @ or as can. how retrieve records in short time without indexes? should orientdb scan entire database @ every query? no. should use graph properties of orientdb."
i personnaly use linkmaps tree did time series use case.
it :
create class lvl1 create class lvl2 create class lvl3 create property lvl1.id integer create property lvl1.lvl2 linkmap lvl2 create property lvl2.lvl3 linkmap lvl3
the keys in linkmap next level node id. depth, use length property of next level linkmap property.
Comments
Post a Comment