The query above started differently: 
    FOR s IN imdb_vertices FOR t IN imdb_vertices FILTER s._id < t._id LET 
p = SUM((...
Judging from this start the query might have complexity N^2 if N is the 
number of vertices.

As to your other query: This will have to build up all edges with label 
"DIRECTED" with their directors and movies and sort by director and movie. 
It will probably only then use the filter conditions. If a director has 
directed two dramas, I would expect it to return the director twice.

I think this can be done better: I think you should first run through the 
directors starting with an A and then use the traversal functionality. If 
your people are stored in the people collection and your movies in the 
movies collection, you could do:

    FOR person IN people 
      FILTER person.name LIKE 'A%' 
      FOR movie, edge IN 1..1 OUTBOUND person imdb_edges 
        FILTER edge.$label == 'DIRECTED' 
        FILTER movie.genre == 'Drama' 
        COLLECT p = person
          RETURN p

This can do a person whose name starts with an at a time and then use the 
graph functionality to find out whether this person has directed a drama. 
The collect now only has to deal with multiple dramas of a single person. I 
would imagine that this will run faster.

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to