The list query seems to speed up quite a bit if the iteration is started from the cvterm instead of annotation collection. So, the existing one ...
FOR ann IN @@anno_collection
FOR v IN 1..1 OUTBOUND ann GRAPH @anno_cvterm_graph
FOR cv IN cv
FILTER ann.is_obsolete == false
FILTER v.deprecated == false
FILTER v.label == @label
FILTER v.graph_id == cv._id
FILTER cv.metadata.namespace == @ontology
LIMIT 10
RETURN ann
should be replace by the following one
FOR cvt IN @@cvterm_collection
FOR cv IN cv
FOR ann IN 1..1 INBOUND cvt GRAPH "annotation_tag"
FILTER cvt.graph_id == cv._id
FILTER cvt.deprecated == false
FILTER cvt.label == @label
FILTER cv.metadata.namespace == @ontology
FILTER ann.is_obsolete == false
RETURN ann
The list query seems to speed up quite a bit if the iteration is started from the
cvterminstead ofannotationcollection. So, the existing one ...should be replace by the following one