If I have one «traversal» like this:
let notWanted = (FOR x in some_collection FILTER on-something RETURN x)
And then later, in another «traversal» (but same query), want to traverse, but PRUNE/FILTER on notWanted
, e.g.
FOR y in some_collection2 … PRUNE y NOT IN notWanted ...
Q: Then I wonder if it was possible to make notWanted
some structure (hash, indexed, etc.) to make the lookup in the second query faster.
By the way, the whole thing is part of the same query.
Already this question Arangodb AQL Filter NOT IN collection, very slow helped me a lot, where instead of returning the full vertex x
I now return x._key
which makes everything much faster, as we now have an array of keys (as I understand it), but knowing that notWanted
is to be used a lot of times in the second query, I’d be beneficial to hint to Arango that I’d want it to be indexed or somthing.