Created events
document in ArangoDB. Loaded 1 million records as shown below which completes in 40 seconds.
FOR I IN 1..1000000
INSERT {
"source": "ABC",
"target": "ABC",
"type": "REST",
"attributes" : { "MyAtrib" : TO_STRING(I)},
"mynum" : I
} INTO events
So record 1 is super parent, and 2 is child of 1 etc.
1 --> 2 --> 3 --> 4 --> ...1000000
Created empty Edge collection ChildEvents
, and tried to establish the parent to child edge relations through the below query, but it never completes (created a hash index on mynum
, but no luck)
FOR p IN events
FOR c IN events
FILTER p.mynum == ( c.mynum + 1 )
INSERT { _from: p._id, _to: c._id} INTO ChildEvents
Any help would be greatly appreciated.