I am working on a route suggestion system between 2 locations. I have a "Locations" document collection(1K docs) and "Service" edge collection(10 lack docs). When I am trying to print all possible routes between 2 random locations, the query is taking forever to run. I have attached the query below. My question here is : Is there any other way of traversing the graph? Is this a common issue or the query is not efficient? Can anyone suggest me some good read on this? QUERY:
let fromDoc= (for loc in Location
sort rand()
limit 1
return loc._id)
let toDoc= (for loc in Location
sort rand()
limit 1
return loc._id)
let pathList = (FOR v, e, p IN 1..3 OUTBOUND fromDoc[0] Service
filter v._id == toDoc[0]
RETURN p)
return pathList
Thanks in advance Archana